# Copyright (C) 2017 Damon Lynch In the illustration above, the first row of the Timeline is black because all the files on
that date had been previously downloaded. The Timeline's slider adjusts the time elapsed between consecutive shots that is used to build
the Timeline: Four types of sequence values are available to help you assign unique names to your photos and
videos:
"""
),
'thumbnailsort.png'
),
(
_(
"One of Rapid Photo Downloader's most useful features is its ability to automatically "
"generate download subfolders and rename files as it downloads, using a scheme of your "
"choosing."
),
'downloadwhereandrename.png',
_(
"To specify where you want your files downloaded and how you want them named, open the "
"appropriate panel on the right-side of the application window: "
"Destination, Rename, or Job Code."
),
),
(
_(
"""
When thinking about your download directory structure, keep in mind two different types
of directory:
"""
),
'defaultdownloaddirectory.png',
_(
"""
You can download photos and videos to the same destination folder, or specify a different
destination folder for each. The same applies to the download subfolders for photos and
videos—download photos and videos to the same subfolders, or use a different scheme for each
type.
"""
)
),
(
_(
"Automatically generated download subfolders can contain further automatically "
"generated subfolders if need be. A common scheme is to create a year "
"subfolder and then a series of year-month-day subfolders within it."
),
'downloadsubfolders.png',
),
(
_(
"""
Whenever possible, the program previews the download subfolders of photos and videos to download:
"""
),
'downloadsubfolders.png',
),
(
_(
"""
Download subfolder names are typically generated using some or all of the following elements:
Naming subfolders with the year, followed by the month and finally the day in numeric format makes
it easy to keep them sorted in a file manager, which is why its the default option:
"""
),
'downloadsubfolders.png',
),
(
_(
"""
To automatically create download subfolders as you download,
you can use one of Rapid Photo Downloader's built-in presets, or create a custom preset. Click on
the gear icon to bring up a drop-down menu:
"""
),
'subfoldermenu.png',
_(
"""
Using the drop-down menu, select a built-in preset or click on Custom to configure your own
scheme. You create your own schemes using the Photo or Video Subfolder Generation Editor:
"""
),
'subfoldergeneration.png',
),
(
_(
"It's easy to download raw images into one folder, and jpeg images into another. "
"Simply use the Filename Extension as part of your download subfolder "
"generation scheme:"
),
'subfoldergenerationext.png',
_('This illustration shows a saved custom preset named "My custom preset".'),
),
(
_(
"""
You do not have to create nested download subfolders. This illustration shows
the generation of download subfolders that contain only the date the photos were taken and a
Job Code:
"""
),
'subfoldergeneration.png'
),
(
_(
"""
Although there are many built-in date/time naming options, you may find that you
need something different. It's no problem to create your own. You can combine date/time choices to
generate new combinations. Supposing you wanted a date format that combines year (YYYY), a hyphen,
and month (MM) to form YYYY-MM. You can create it like this (note the red circle around the hyphen):
"""
),
'customdate.png',
_(
"""
Read more about all the ways you can generate download subfolder names and file names in the online documentation.
"""
)
),
(
_(
"""
Job Codes let you easily enter text that describes sets of photos and videos. You can
use them in subfolder and file names. In this illustration, some files have had the Job Code
"Street" applied to them, and the selected files are about to get the Job Code
"Green Bazaar":
"""
),
'jobcodes.png',
_(
"""
You can apply new or existing Job Codes before you start a download. If there are any
files in the download that have not yet had a Job Code applied to them, you'll be prompted to enter
a Job Code for them before the download begins.
"""
)
),
(
_(
"Look for hints to guide you when working with Job Codes:"
),
'jobcodehint.png',
_(
"Hints will vary depending on the context, such as when the mouse is hovering over a "
"button."
)
),
(
_(
"""
When you give your photos and videos unique filenames, you'll never be confused as to
which file is which. Using sequence numbers to make filenames unique is highly
recommended!
"""
),
'photoeditordefault.png',
_(
"""
Read more about sequence numbers in the online documentation.
""" ), ), ( _( """ The Rename panel allows you to configure file renaming. To rename your files, you can choose from among existing renaming presets or define your own. """ ), 'renameoptions.png', _( """The Synchronize RAW + JPEG option is useful if you use the RAW + JPEG feature on your camera and you use sequence numbers in your photo renaming. Enabling this option will cause the program to detect matching pairs of RAW and JPEG photos, and when they are detected, the same sequence numbers will be applied to both photo names. Furthermore, sequences will be updated as if the photos were one.
Read more about file renaming in the online documentation.
""" ) ), ( _( """ You can have your photos and videos backed up to multiple locations as they are downloaded, such as external hard drives or network shares. Backup devices can be automatically detected, or exact backup locations specified. """ ), 'backup.png', _( "In this example, the drive photobackup does not contain a folder named " "Videos, so videos will not be backed up to it." ) ), ( _( """ Several of the program's preferences can be set from the command line, including download sources, destinations, and backups. Additionally, settings can be reset to their default state, and caches and remembered files cleared. """ ) + _("You can also import program preferences from the older 0.4 version."), 'commandline.png' ), ( _( """ Rapid Photo Downloader deals with three types of cache:'): text = '{}
{}
'.format(text, value) else: text = '{}{}'.format(text, value) else: text = '{}'.format(text, value) return text def __len__(self): return len(tips) class DidYouKnowDialog(QDialog): def __init__(self, prefs: Preferences, parent=None) -> None: super().__init__(parent) self.rapidApp = parent self.prefs = prefs self.setWindowTitle(_("Tip of the Day")) self.setSizeGripEnabled(True) titleFont = QFont() titleFont.setPointSize(titleFont.pointSize() + 3) pixsize = int(QFontMetrics(QFont()).height() * 1.75) title = QLabel(_('Did you know...?')) title.setFont(titleFont) pixmap = QIcon(':/did-you-know.svg').pixmap(QSize(pixsize, pixsize)) # type: QPixmap icon = QLabel() icon.setPixmap(pixmap) titleLayout = QHBoxLayout() titleLayout.addWidget(icon) titleLayout.addWidget(title) titleLayout.addStretch() self.text = QTextBrowser() self.text.setOpenExternalLinks(True) self.text.setViewportMargins(10, 10, 10, 10) self.text.setStyleSheet(""" QTextEdit { background: palette(base); } """) self.text.document().setDefaultStyleSheet( """ b {color: grey;} tt {color: darkRed; font-weight: bold;} """ ) self.tips = Tips() self.showTips = QCheckBox(_('Show tips on startup')) self.showTips.setChecked(self.prefs.did_you_know_on_startup) self.showTips.stateChanged.connect(self.showTipsChanged) self.nextButton = QPushButton(_('&Next')) self.previousButton = QPushButton(_('&Previous')) buttons = QDialogButtonBox(QDialogButtonBox.Close) translateButtons(buttons) buttons.addButton(self.previousButton, QDialogButtonBox.ActionRole) buttons.addButton(self.nextButton, QDialogButtonBox.ActionRole) self.previousButton.clicked.connect(self.previousButtonClicked) self.nextButton.clicked.connect(self.nextButtonClicked) buttons.rejected.connect(self.close) layout = QVBoxLayout() self.setLayout(layout) layout.addLayout(titleLayout) layout.addWidget(self.text) layout.addWidget(self.showTips) layout.addWidget(buttons) settings = QSettings() settings.beginGroup("DidYouKnowWindow") default_width = 570 default_height = 350 size = settings.value("windowSize", QSize(default_width, default_height)) settings.endGroup() self.resize(size) self.showTip() def incrementTip(self) -> None: if self.prefs.did_you_know_index + 1 == len(self.tips): self.prefs.did_you_know_index = 0 else: self.prefs.did_you_know_index = self.prefs.did_you_know_index + 1 def decrementTip(self) -> None: if self.prefs.did_you_know_index == 0: self.prefs.did_you_know_index = len(self.tips) - 1 else: self.prefs.did_you_know_index = self.prefs.did_you_know_index - 1 def showTip(self) -> None: self.text.clear() self.text.append(self.tips[self.prefs.did_you_know_index]) self.text.moveCursor(QTextCursor.Start) def showEvent(self, event: QShowEvent) -> None: self.nextButton.setDefault(True) self.nextButton.setFocus(Qt.OtherFocusReason) event.accept() @pyqtSlot(int) def showTipsChanged(self, state: int) -> None: self.prefs.did_you_know_on_startup = state == Qt.Checked @pyqtSlot() def nextButtonClicked(self) -> None: self.incrementTip() self.showTip() @pyqtSlot() def previousButtonClicked(self) -> None: self.decrementTip() self.showTip() @pyqtSlot() def activate(self) -> None: self.showTip() self.setVisible(True) self.activateWindow() self.raise_() def reject(self) -> None: """ Called when user hits escape key """ self.saveSettings() if self.rapidApp is None: super().reject() def closeEvent(self, event: QCloseEvent) -> None: self.saveSettings() if self.rapidApp is None: event.accept() else: event.ignore() self.hide() def saveSettings(self) -> None: self.incrementTip() settings = QSettings() settings.beginGroup("DidYouKnowWindow") settings.setValue("windowSize", self.size()) settings.endGroup() if __name__ == '__main__': # Application development test code: app = QApplication([]) app.setOrganizationName("Rapid Photo Downloader") app.setOrganizationDomain("damonlynch.net") app.setApplicationName("Rapid Photo Downloader") prefs = Preferences() dialog = DidYouKnowDialog(prefs=prefs) dialog.show() app.exec_()