Skip to Content.
Sympa Menu

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

idok-commit AT lists.psi.ch

Subject: Commit emails of the iDok project

List archive

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


Chronological Thread 
  • From: "Apache" <apache AT savannah.psi.ch>
  • To: idok-commit AT lists.psi.ch
  • Subject: [idok-commit] idok commit r89 - trunk/java/ch/idok/qtgui
  • Date: Tue, 6 May 2008 16:43:39 +0200
  • 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 AT PSI.CH
Date: Tue May 6 16:43:39 2008
New Revision: 89

Log:
Files that need to be converted (e.g. ppt,doc,odt) or take longer to display
(pdf) will now show a "Preview" button that has to be pressed instead of the
automatic preview.

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

Modified: trunk/java/ch/idok/qtgui/PreviewWidget.java
==============================================================================
--- trunk/java/ch/idok/qtgui/PreviewWidget.java (original)
+++ trunk/java/ch/idok/qtgui/PreviewWidget.java Tue May 6 16:43:39 2008
@@ -63,6 +63,7 @@
import com.trolltech.qt.gui.QMouseEvent;
import com.trolltech.qt.gui.QPalette;
import com.trolltech.qt.gui.QPixmap;
+import com.trolltech.qt.gui.QPushButton;
import com.trolltech.qt.gui.QScrollArea;
import com.trolltech.qt.gui.QSpacerItem;
import com.trolltech.qt.gui.QSpinBox;
@@ -83,6 +84,8 @@
private QLabel docLabel_;

private QSpinBox pdfPageSpinBox_;
+
+ private QPushButton previewButton_;

int numPages_;

@@ -110,6 +113,8 @@
private File tempPageFile_ = null;

public Signal1<RepositoryPath> documentSelected = new
Signal1<RepositoryPath>();
+
+ public boolean enablePreview = false;

private PDFFile pdfFile_ = null;

@@ -143,7 +148,7 @@
scrollArea_.setWidgetResizable(true);

layouter_ = new QGridLayout(this);
- layouter_.addWidget(scrollArea_, 0, 0, 1, 3);
+ layouter_.addWidget(scrollArea_, 0, 0, 1, 5);

// now the "caption line"
docLabel_ = new QLabel();
@@ -153,8 +158,13 @@
com.trolltech.qt.gui.QSizePolicy.Policy.Expanding,
com.trolltech.qt.gui.QSizePolicy.Policy.Minimum);
layouter_.addItem(spacerItem, 1, 1);
+ previewButton_ = new QPushButton("Preview");
+ layouter_.addWidget(previewButton_, 1, 2);
+ previewButton_.clicked.connect(this,"enablePreview()");
+ previewButton_.hide();
+ layouter_.addItem(spacerItem, 1, 3);
pdfPageSpinBox_ = new QSpinBox();
- layouter_.addWidget(pdfPageSpinBox_, 1, 2);
+ layouter_.addWidget(pdfPageSpinBox_, 1, 4);
pdfPageSpinBox_.valueChanged.connect(this, "newPage()");
pdfPageSpinBox_.hide();

@@ -184,6 +194,11 @@
}
}
}
+
+ private void enablePreview(){
+ enablePreview = true;
+ setDmsContents(repoCon_, repPath_);
+ }

public void setLocalContents(String fileName) {
fileName_ = fileName;
@@ -204,7 +219,20 @@
repoC.getCurrentRepo().getDocumentData(repPath, os, null);
os.close();
String name = repPath.getDocumentId().getTail();
- previewData(name);
+ if(!enablePreview && (name.endsWith("pdf") |
name.endsWith("odt") | name.endsWith("sxw")
+ | name.endsWith("rtf") |
name.endsWith("doc") | name.endsWith("wdp")
+ | name.endsWith("ods") |
name.endsWith("sxc") | name.endsWith("xls")
+ | name.endsWith("csv") |
name.endsWith("tsv") | name.endsWith("odp")
+ | name.endsWith("sxi") |
name.endsWith("ppt"))){
+ textView_.setText("<b> Please press the button below to
generate a preview </b>");
+ enableTextView();
+ previewButton_.show();
+ pdfPageSpinBox_.hide();
+ }else{
+ previewData(name);
+ previewButton_.hide();
+ }
+ enablePreview = false;
tempFile.delete();
docLabel_.setText("<b>" + name + "</b>");
} catch (DmsException e) {



  • [idok-commit] idok commit r89 - trunk/java/ch/idok/qtgui, Apache, 05/06/2008

Archive powered by MHonArc 2.6.19.

Top of Page