Skip to Content.
Sympa Menu

idok-commit - [idok-commit] idok commit r319 - trunk/java/ch/idok/qtgui

idok-commit AT lists.psi.ch

Subject: Commit emails of the iDok project

List archive

[idok-commit] idok commit r319 - trunk/java/ch/idok/qtgui


Chronological Thread 
  • From: "AFS account Florian Huebner" <huebner AT savannah.psi.ch>
  • To: idok-commit AT lists.psi.ch
  • Subject: [idok-commit] idok commit r319 - trunk/java/ch/idok/qtgui
  • Date: Mon, 2 Feb 2009 15:33:23 +0100
  • List-archive: <https://lists.web.psi.ch/pipermail/idok-commit/>
  • List-id: Commit emails of the iDok project <idok-commit.lists.psi.ch>

Author: huebner
Date: Mon Feb 2 15:33:22 2009
New Revision: 319

Log:
Fixed a problem that occurred when trying to preview local files.

Modified:
trunk/java/ch/idok/qtgui/PreviewWidget.java
trunk/java/ch/idok/qtgui/StartExternalProgram.java

Modified: trunk/java/ch/idok/qtgui/PreviewWidget.java
==============================================================================
--- trunk/java/ch/idok/qtgui/PreviewWidget.java (original)
+++ trunk/java/ch/idok/qtgui/PreviewWidget.java Mon Feb 2 15:33:22 2009
@@ -87,8 +87,6 @@

private QSpinBox pdfPageSpinBox_;

- private QPushButton previewButton_;
-
private QPushButton previewAsTextButton_;

private QPushButton previewExternalButton_;
@@ -258,7 +256,6 @@
public void setLocalContents(String fileName) {
localFile = true;
previewAsTextButton_.hide();
- previewButton_.hide();
previewZoomBox_.hide();
enablePreviewAnyway = false;
fileName_ = fileName;
@@ -305,7 +302,7 @@


private boolean previewFileSizeWithin(int sizeLimitMB, String text){
- if
((repoCon_.getFileSize()>(sizeLimitMB*1000000))&&!enablePreviewAnyway) {
+ if ((!localFile && !enablePreviewAnyway &&
repoCon_.getFileSize()>(sizeLimitMB*1000000))) {
pdfPageSpinBox_.hide();
previewAnywayButton_.show();
previewExternalButton_.show();
@@ -322,7 +319,12 @@

private void previewData(String name) {
setCursor(BUSYCURSOR);
- startex.setPath(repPath_);
+ if (localFile) {
+ startex.setLocalPath(name);
+ }else {
+ startex.setPath(repPath_);
+ }
+


String ext = new String("");

Modified: trunk/java/ch/idok/qtgui/StartExternalProgram.java
==============================================================================
--- trunk/java/ch/idok/qtgui/StartExternalProgram.java (original)
+++ trunk/java/ch/idok/qtgui/StartExternalProgram.java Mon Feb 2 15:33:22
2009
@@ -40,6 +40,7 @@
private Logger logger_ =
Setup.getInstance().getLogger("qtgui.StartExternalProgram");
private QTreeWidgetItem selectedDocItem_;
private RepositoryPath repPath;
+ private String localPath;

// public StartExternalProgram(QTreeWidgetItem item) {
// selectedDocItem_ = item;
@@ -49,25 +50,32 @@
}

public void setPath(RepositoryPath path){
- repPath = path;
+ repPath = path;
+ }
+
+ public void setLocalPath(String path){
+ localPath = path;
}

public final void externalViewer() {
- if (selectedDocItem_ != null) {
+ if (repPath != null && selectedDocItem_ != null) {
repPath = (RepositoryPath) selectedDocItem_.data(0,
Qt.ItemDataRole.UserRole);
- }
String arg = null;
try {
arg = repPath.getURI().toASCIIString();
externalProgram(arg);
} catch (DmsException e) {
- // TODO Auto-generated catch block
-// e.getLogMessage();
logger_.log(Level.WARNING, "Unable to start an external
viewer for: " + repPath.getDocumentId(), e);
-
}
+
+
+ }else{
+ String arg = null;
+ arg = localPath;
+ externalProgram(arg);
}
+ }


public final void pdfViewer() {



  • [idok-commit] idok commit r319 - trunk/java/ch/idok/qtgui, AFS account Florian Huebner, 02/02/2009

Archive powered by MHonArc 2.6.19.

Top of Page