diff options
Diffstat (limited to 'rapid')
-rw-r--r-- | rapid/ChangeLog | 20 | ||||
-rw-r--r-- | rapid/config.py | 2 | ||||
-rw-r--r-- | rapid/glade3/rapid.glade | 17 | ||||
-rwxr-xr-x | rapid/rapid.py | 93 | ||||
-rw-r--r-- | rapid/renamesubfolderprefs.py | 4 |
5 files changed, 104 insertions, 32 deletions
diff --git a/rapid/ChangeLog b/rapid/ChangeLog index 3a0914d..668fc58 100644 --- a/rapid/ChangeLog +++ b/rapid/ChangeLog @@ -1,3 +1,23 @@ +Version 0.1.0 +------------- + +2009-12-07 + +Added icons to notification messages. + +Updated Czech, French, German, Hungarian, Polish, Russian, Slovak, Spanish and +Swedish translations. + +Bug fix: properly handle devices being unmounted, fixing a bug introduced in +Version 0.0.9 beta 2. + +Bug fix: When program preferences are changed, image and backup devices are now +refreshed only when the preferences dialog window is closed. + +Bug fix: Minutes component of image and folder renaming had the same code as +months. + + Version 0.1.0 beta 2 -------------------- diff --git a/rapid/config.py b/rapid/config.py index c970977..0428eab 100644 --- a/rapid/config.py +++ b/rapid/config.py @@ -15,7 +15,7 @@ ### along with this program; if not, write to the Free Software ### Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -version = '0.1.0~b2' +version = '0.1.0' GCONF_KEY="/apps/rapid-photo-downloader" GLADE_FILE = "glade3/rapid.glade" diff --git a/rapid/glade3/rapid.glade b/rapid/glade3/rapid.glade index 860a54b..a485c42 100644 --- a/rapid/glade3/rapid.glade +++ b/rapid/glade3/rapid.glade @@ -1014,11 +1014,11 @@ <property name="layout_style">start</property> <child> <widget class="GtkButton" id="add_job_code_button"> - <property name="label">gtk-add</property> + <property name="label" translatable="yes">_Add...</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> - <property name="use_stock">True</property> + <property name="use_underline">True</property> <signal name="clicked" handler="on_add_job_code_button_clicked"/> </widget> <packing> @@ -1044,7 +1044,7 @@ </child> <child> <widget class="GtkButton" id="clear_job_code_button"> - <property name="label" translatable="yes" comments="The underscore after the C signifies that the l is the accelerator key. This is the standard 'Clear' button, but I needed to change the accelerator from the standard 'c' to 'l' because the close button also used 'c'">C_lear</property> + <property name="label" translatable="yes" comments="The underscore after the C signifies that the l is the accelerator key. This is the standard 'Clear' button, but I needed to change the accelerator from the standard 'c' to 'l' because the close button also used 'c'">R_emove All</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -2371,13 +2371,14 @@ Rapid Photo Downloader is distributed in the hope that it will be useful, but WI You should have received a copy of the GNU General Public License along with Rapid Photo Downloader; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</property> <property name="authors">Damon Lynch <damonlynch@gmail.com></property> - <property name="translator_credits" comments="TRANSLATORS: Replace this string with your names, one name per line.">Michel Ange <michelange@wanadoo.fr> + <property name="translator_credits">Lőrincz András <level.andrasnak@gmail.com> +Michel Ange <michelange@wanadoo.fr> Martin Egger <martin.egger@gmx.net> -Lőrincz András <level.andrasnak@gmail.com> +Nicolás M. Zahlut <nzahlut@live.com> Jose Luis Navarro <jlnavarro111@gmail.com> Tomas Novak <kuvaly@seznam.cz> Abel O'Rian <abel.orian@gmail.com> -Balazs Oveges +Balazs Oveges <ovegesb@freemail.hu> Daniel Paessler <daniel@paessler.org> Michal Predotka <mpredotka@googlemail.com> Luca Reverberi <thereve@gmail.com> @@ -2385,9 +2386,7 @@ Mikko Ruohola <polarfox@polarfox.net> Sergei Sedov <sedov@webmail.perm.ru> Marco Solari <marcosolari@gmail.com> Ulf Urdén <ulf.urden@purplescout.com> -Julien Valroff <julien@kirya.net> - -</property> +Julien Valroff <julien@kirya.net></property> <property name="logo">rapid-photo-downloader-about.png</property> <property name="wrap_license">True</property> <child internal-child="vbox"> diff --git a/rapid/rapid.py b/rapid/rapid.py index e270a6a..a18f88e 100755 --- a/rapid/rapid.py +++ b/rapid/rapid.py @@ -656,6 +656,10 @@ class PreferencesDialog(gnomeglade.Component): self.widget.set_transient_for(parentApp.widget) self.prefs = parentApp.prefs + + parentApp.preferencesDialogDisplayed = True + + self.parentApp = parentApp self._setupTabSelector() @@ -1041,10 +1045,14 @@ class PreferencesDialog(gnomeglade.Component): self.prefs.subfolder = self.prefs.get_default("subfolder") self.widget.destroy() + self.parentApp.preferencesDialogDisplayed = False + self.parentApp.postPreferenceChange() + + def on_add_job_code_button_clicked(self, button): - j = JobCodeDialog(self.widget, self.prefs.job_codes, None, self.add_job_code, False) + j = JobCodeDialog(self.widget, self.prefs.job_codes, None, self.add_job_code, False, True) def add_job_code(self, dialog, userChoseCode, job_code, autoStart): @@ -1749,6 +1757,13 @@ class CopyPhotos(Thread): message = "%s\n%s " % (message, self.noErrors) + _("errors") n = pynotify.Notification(notificationName, message) + + if self.cardMedia.volume: + icon = self.cardMedia.volume.get_icon_pixbuf(self.parentApp.notification_icon_size) + else: + icon = self.parentApp.application_icon + + n.set_icon_from_pixbuf(icon) n.show() @@ -1977,7 +1992,7 @@ class CopyPhotos(Thread): def on_volume_unmount(self, data1, data2): """ needed for call to unmount volume""" - pass + pass class MediaTreeView(gtk.TreeView): @@ -2169,6 +2184,8 @@ class UseDeviceDialog(gtk.Dialog): # Translators: for an explanation of what this means, see http://damonlynch.net/rapid/documentation/index.html#usedeviceprompt prompt_label = gtk.Label(_('Should this device or partition be used to download images from?')) prompt_label.set_line_wrap(True) + prompt_hbox = gtk.HBox() + prompt_hbox.pack_start(prompt_label, False, False, padding=6) device_label = gtk.Label() device_label.set_markup("<b>%s</b>" % volume.get_name(limit=0)) device_hbox = gtk.HBox() @@ -2198,7 +2215,7 @@ class UseDeviceDialog(gtk.Dialog): self.vbox.pack_start(device_hbox, padding=6) self.vbox.pack_start(path_hbox, padding = 6) - self.vbox.pack_start(prompt_label, padding=6) + self.vbox.pack_start(prompt_hbox, padding=6) self.vbox.pack_start(self.always_checkbutton, padding=6) self.set_border_width(6) @@ -2238,7 +2255,7 @@ class UseDeviceDialog(gtk.Dialog): class JobCodeDialog(gtk.Dialog): """ Dialog prompting for a job code""" - def __init__(self, parent_window, job_codes, default_job_code, postJobCodeEntryCB, autoStart): + def __init__(self, parent_window, job_codes, default_job_code, postJobCodeEntryCB, autoStart, entryOnly): # Translators: for an explanation of what this means, see http://damonlynch.net/rapid/documentation/index.html#jobcode gtk.Dialog.__init__(self, _('Enter a Job Code'), None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, @@ -2256,7 +2273,7 @@ class JobCodeDialog(gtk.Dialog): self.job_code_hbox = gtk.HBox(homogeneous = False) - if len(job_codes): + if len(job_codes) and not entryOnly: # Translators: for an explanation of what this means, see http://damonlynch.net/rapid/documentation/index.html#jobcode task_label = gtk.Label(_('Enter a new job code, or select a previous one.')) else: @@ -2463,7 +2480,14 @@ class RapidApp(gnomeglade.GnomeApp, dbus.service.Object): if self.usingVolumeMonitor(): self.startVolumeMonitor() - + # flag to indicate whether the user changed some preferences that + # indicate the image and backup devices should be setup again + self.rerunSetupAvailableImageAndBackupMedia = False + + # flag to indicate that the preferences dialog window is being + # displayed to the user + self.preferencesDialogDisplayed = False + # set up tree view display to display image devices and download status media_collection_treeview = MediaTreeView(self) @@ -2606,7 +2630,7 @@ class RapidApp(gnomeglade.GnomeApp, dbus.service.Object): if not self.prompting_for_job_code: cmd_line(_("Prompting for Job Code")) self.prompting_for_job_code = True - j = JobCodeDialog(self.widget, self.prefs.job_codes, self.last_chosen_job_code, postJobCodeEntryCB, autoStart) + j = JobCodeDialog(self.widget, self.prefs.job_codes, self.last_chosen_job_code, postJobCodeEntryCB, autoStart, False) else: cmd_line(_("Already prompting for Job Code, do not prompt again")) @@ -2713,6 +2737,16 @@ class RapidApp(gnomeglade.GnomeApp, dbus.service.Object): capabilities[cap] = True info = pynotify.get_server_info() + + if info['name'] == 'Notification Daemon': + self.notification_icon_size = 48 + else: + self.notification_icon_size = 128 + + self.application_icon = gtk.gdk.pixbuf_new_from_file_at_size( + paths.share_dir('glade3/rapid-photo-downloader-about.png'), + self.notification_icon_size, self.notification_icon_size) + def usingVolumeMonitor(self): """ @@ -2833,8 +2867,9 @@ class RapidApp(gnomeglade.GnomeApp, dbus.service.Object): callback run when gnomevfs indicates a volume has been unmounted """ - volume = Volume(volume) - path = volume.get_path() + + v = Volume(volume) + path = v.get_path() # four scenarios - # volume is waiting to be scanned @@ -2844,15 +2879,18 @@ class RapidApp(gnomeglade.GnomeApp, dbus.service.Object): if path: # first scenario + for w in workers.getReadyToStartWorkers(): - if w.cardMedia.volume == volume: - media_collection_treeview.removeCard(w.thread_id) - workers.disableWorker(w.thread_id) + if w.cardMedia.volume: + if w.cardMedia.volume.volume == volume: + media_collection_treeview.removeCard(w.thread_id) + workers.disableWorker(w.thread_id) # second scenario for w in workers.getReadyToDownloadWorkers(): - if w.cardMedia.volume == volume: - media_collection_treeview.removeCard(w.thread_id) - workers.disableWorker(w.thread_id) + if w.cardMedia.volume: + if w.cardMedia.volume.volume == volume: + media_collection_treeview.removeCard(w.thread_id) + workers.disableWorker(w.thread_id) # fourth scenario - nothing to do @@ -2861,7 +2899,9 @@ class RapidApp(gnomeglade.GnomeApp, dbus.service.Object): if backupPath in self.backupVolumes: del self.backupVolumes[backupPath] self.rapid_statusbar.push(self.statusbar_context_id, self.displayBackupVolumes()) - + + # may need to disable download button + self.setDownloadButtonSensitivity() def clearCompletedDownloads(self): @@ -3135,6 +3175,7 @@ class RapidApp(gnomeglade.GnomeApp, dbus.service.Object): if self.downloadStats.noErrors: message = "%s\n%s " % (message, self.downloadStats.noErrors) +_("errors") n = pynotify.Notification(PROGRAM_NAME, message) + n.set_icon_from_pixbuf(self.application_icon) n.show() self.displayDownloadSummaryNotification = False # don't show it again unless needed self.downloadStats.clear() @@ -3289,7 +3330,20 @@ class RapidApp(gnomeglade.GnomeApp, dbus.service.Object): elif key == 'show_log_dialog': self.menu_log_window.set_active(value) elif key in ['device_autodetection', 'device_autodetection_psd', 'backup_images', 'device_location', - 'backup_device_autodetection', 'backup_location' ]: + 'backup_device_autodetection', 'backup_location' ]: + self.rerunSetupAvailableImageAndBackupMedia = True + if not self.preferencesDialogDisplayed: + self.postPreferenceChange() + + elif key in ['subfolder', 'image_rename']: + global need_job_code + need_job_code = self.needJobCode() + + def postPreferenceChange(self): + """ + Handle changes in program preferences after the preferences dialog window has been closed + """ + if self.rerunSetupAvailableImageAndBackupMedia: if self.usingVolumeMonitor(): self.startVolumeMonitor() cmd_line("\n" + _("Preferences were changed.")) @@ -3298,9 +3352,8 @@ class RapidApp(gnomeglade.GnomeApp, dbus.service.Object): if is_beta and verbose: print "Current worker status:" workers.printWorkerStatus() - elif key in ['subfolder', 'image_rename']: - global need_job_code - need_job_code = self.needJobCode() + + self.rerunSetupAvailableImageAndBackupMedia = False diff --git a/rapid/renamesubfolderprefs.py b/rapid/renamesubfolderprefs.py index f28e068..71f9089 100644 --- a/rapid/renamesubfolderprefs.py +++ b/rapid/renamesubfolderprefs.py @@ -162,7 +162,7 @@ LIST_DATE_TIME_L2 = ['YYYYMMDD', 'YYYY-MM-DD','YYMMDD', 'YY-MM-DD', 'MMDDYYYY', 'MMDDYY', 'MMDD', 'DDMMYYYY', 'DDMMYY', 'YYYY', 'YY', 'MM', 'DD', - 'HHMMSS', 'HHMM', 'HH-MM-SS', 'HH-MM', 'HH', 'MM', 'SS'] + 'HHMMSS', 'HHMM', 'HH-MM-SS', 'HH-MM', 'HH', 'MM (minutes)', 'SS'] LIST_IMAGE_DATE_TIME_L2 = LIST_DATE_TIME_L2 + [SUBSECONDS] @@ -286,7 +286,7 @@ class i18TranslateMeThanks: # Translators: for an explanation of what this means, see http://damonlynch.net/rapid/documentation/index.html#renamedateandtime _('HH') # Translators: for an explanation of what this means, see http://damonlynch.net/rapid/documentation/index.html#renamedateandtime - _('MM') + _('MM (minutes)') # Translators: for an explanation of what this means, see http://damonlynch.net/rapid/documentation/index.html#renamedateandtime _('SS') |