add: ScreenshotRepositoryBase, so one can set that path in the config…
… file
- Loading branch information...
| @@ -90,6 +90,8 @@ | ||
| private BrowserLauncher launcher = null; | ||
| + private String screenshotRepositoryPath; | ||
| + | ||
| /** | ||
| * Holds the currently valid screenshot url, for threading reasons | ||
| */ | ||
| @@ -109,8 +111,10 @@ private ImageIcon createImageIcon(String path, String description) { | ||
| } | ||
| - public PackageDetailPanel() { | ||
| + public PackageDetailPanel(String screenshotRepositoryPath) { | ||
SpiritQuaddicted
Owner
|
||
| super(new GridBagLayout()); | ||
| + | ||
| + this.screenshotRepositoryPath = screenshotRepositoryPath; | ||
SpiritQuaddicted
Owner
|
||
| { | ||
| try { | ||
| @@ -267,9 +271,8 @@ private void refreshUi() { | ||
| image.setIcon(null); | ||
| - | ||
| - supposedImageUrl = "http://www.quaddicted.com/reviews/screenshots/" + current.getId() | ||
| - +"_injector.jpg"; | ||
| + | ||
| + supposedImageUrl = screenshotRepositoryPath + current.getId() + "_injector.jpg"; | ||
SpiritQuaddicted
Owner
|
||
| //load image in bg thread | ||
| new SwingWorker<ImageIcon,Void>() { | ||
| @@ -304,7 +307,7 @@ public void done() { | ||
| if (icon == null || icon.getImageLoadStatus() != java.awt.MediaTracker.COMPLETE) { | ||
| removeImage(); | ||
| - System.err.println("Couldn't load image " + current.getId()); | ||
| + System.err.println("Couldn't load image " + supposedImageUrl); | ||
SpiritQuaddicted
Owner
|
||
| } | ||
| else { | ||
| image.setIcon(icon); | ||
| @@ -149,7 +149,6 @@ public QuakeInjector() { | ||
| setMinimumSize(new Dimension(minWidth, minHeight)); | ||
| - addMainPane(getContentPane()); | ||
| addWindowListener(new QuakeInjectorWindowListener()); | ||
| @@ -171,6 +170,7 @@ public QuakeInjector() { | ||
| //config needed here | ||
| setWindowSize(); | ||
| + addMainPane(getContentPane()); | ||
SpiritQuaddicted
Owner
|
||
| } | ||
| /** | ||
| @@ -195,7 +195,7 @@ public void actionPerformed(ActionEvent e) { | ||
| public void actionPerformed(ActionEvent e) { | ||
| setVisible(false); | ||
| dispose(); | ||
| - } | ||
| + } | ||
| }; | ||
| ActionListener showEngineConfig = new ActionListener() { | ||
| @@ -353,7 +353,7 @@ private InputStream downloadDatabase(String databaseUrl) throws IOException { | ||
| } | ||
| catch (IOException e) { | ||
| //try reading the cached version if downloading fails | ||
| - System.err.println("Downloading the database failed."); | ||
| + System.err.println("Downloading the database failed. "+databaseUrl); | ||
| if (cache.exists() && cache.canRead()) { | ||
| System.err.println("Using cached database file (" + cache + ") instead."); | ||
| db = new BufferedInputStream(new FileInputStream(cache)); | ||
| @@ -708,8 +708,10 @@ private void filter() { | ||
| this.interactionPanel = new PackageInteractionPanel(this, installQueue); | ||
| JPanel infoPanel = new JPanel(new GridBagLayout()); | ||
| - | ||
| - PackageDetailPanel details = new PackageDetailPanel(); | ||
| + | ||
| + Configuration config = getConfig(); | ||
|
|
||
| + PackageDetailPanel details = new PackageDetailPanel(config.ScreenshotRepositoryPath.get()); | ||
SpiritQuaddicted
Owner
|
||
| + | ||
| infoPanel.add(details, new GridBagConstraints() {{ | ||
| anchor = PAGE_START; | ||
| fill = BOTH; | ||
1 comment
on commit c1b0008
hrehfeld
commented on c1b0008
Jul 10, 2011
|
mrg: spirits screenshot url cfg patch |
Simply copied the RepositoryDatabasePath block and changed it to ScreenshotRepositoryPath. Gives a default value.