idok-commit AT lists.psi.ch
Subject: Commit emails of the iDok project
List archive
- From: "Apache" <apache AT savannah.psi.ch>
- To: idok-commit AT lists.psi.ch
- Subject: [idok-commit] idok commit r139 - trunk/java/ch/idok/qtgui
- Date: Mon, 7 Jul 2008 16:36:59 +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: Mon Jul 7 16:36:59 2008
New Revision: 139
Log:
Added feature IDO-185:Add file extension column to allow sorting by file type
Modified:
trunk/java/ch/idok/qtgui/BrowseController.java
trunk/java/ch/idok/qtgui/DocumentController.java
trunk/java/ch/idok/qtgui/FolderTree.java
trunk/java/ch/idok/qtgui/SearchController.java
Modified: trunk/java/ch/idok/qtgui/BrowseController.java
==============================================================================
--- trunk/java/ch/idok/qtgui/BrowseController.java (original)
+++ trunk/java/ch/idok/qtgui/BrowseController.java Mon Jul 7 16:36:59
2008
@@ -72,6 +72,7 @@
// tr-Tags?
private void setupHeader() {
header_.add("Name");
+ header_.add("File type");
header_.add("Commited by");
header_.add("Size");
header_.add("Date committed");
Modified: trunk/java/ch/idok/qtgui/DocumentController.java
==============================================================================
--- trunk/java/ch/idok/qtgui/DocumentController.java (original)
+++ trunk/java/ch/idok/qtgui/DocumentController.java Mon Jul 7 16:36:59
2008
@@ -127,20 +127,21 @@
newItem.setData(0, Qt.ItemDataRole.UserRole, repo
.getRepositoryPathFromCurrentId(
repPath.getDocumentId(),
entry.getVersion()));
- newItem.setText(1, entry.getAuthor());
+ newItem.setText(1, item.text(1));
+ newItem.setText(2, entry.getAuthor());
// size info not contained in log entries
- newItem.setText(2, "");
+ newItem.setText(3, "");
// turn Java Date into Qt QDateTime object (note: tiny
// differences in format between Java and Qt)
// QDateTime d =
QDateTime.fromString(f.format(entry.getDate()),
// "yyyy-MM-dd HH:mm:ss.zzz");
- newItem.setText(3, f.format(entry.getDate()));
- newItem.setText(4, String.format("%6s", entry.getVersion()
+ newItem.setText(4, f.format(entry.getDate()));
+ newItem.setText(5, String.format("%6s", entry.getVersion()
.toString()));
String message = entry.getLogMessage();
- newItem.setText(5, message.substring(0, Math.min(40, message
+ newItem.setText(6, message.substring(0, Math.min(40, message
.length())));
- newItem.setData(5, Qt.ItemDataRole.ToolTipRole, message);
+ newItem.setData(6, Qt.ItemDataRole.ToolTipRole, message);
ui_.browseTreeWidget.setCurrentItem(item);
ui_.browseTreeWidget.scrollToItem(item,
ScrollHint.PositionAtCenter);
}
Modified: trunk/java/ch/idok/qtgui/FolderTree.java
==============================================================================
--- trunk/java/ch/idok/qtgui/FolderTree.java (original)
+++ trunk/java/ch/idok/qtgui/FolderTree.java Mon Jul 7 16:36:59 2008
@@ -395,11 +395,19 @@
} else {
entry = e;
}
- item.setText(0, entry.getId().getTail());
- item.setText(1, entry.getAuthor());
- item.setText(2, String.format("%10s", entry.getSize()));
- item.setText(3, f.format(entry.getDate()));
- item.setText(4, String.format("%6s", entry.getVersion().toString()));
+ String name = entry.getId().getTail();
+ if ((name.split("\\.").length-1) <=0 ) {
+ item.setText(0, name);
+ item.setText(1, "");
+ }else{
+ String type =
name.split("\\.")[name.split("\\.").length-1].toString();
+ item.setText(0,name.substring(0,
(name.length()-type.length()-1)));
+ item.setText(1,type);
+ }
+ item.setText(2, entry.getAuthor());
+ item.setText(3, String.format("%10s", entry.getSize()));
+ item.setText(4, f.format(entry.getDate()));
+ item.setText(5, String.format("%6s", entry.getVersion().toString()));
item.setChildIndicatorPolicy(ChildIndicatorPolicy.ShowIndicator);
if (entry.isLocked()) {
Modified: trunk/java/ch/idok/qtgui/SearchController.java
==============================================================================
--- trunk/java/ch/idok/qtgui/SearchController.java (original)
+++ trunk/java/ch/idok/qtgui/SearchController.java Mon Jul 7 16:36:59
2008
@@ -105,6 +105,7 @@
private void setupHeader() {
header_.add("Name");
+ header_.add("File type");
header_.add("Environment");
header_.add("Commited by");
header_.add("Size");
@@ -284,22 +285,31 @@
// command
newItem.setData(0, Qt.ItemDataRole.UserRole, path);
+ String name = filePath;
+ if ((name.split("\\.").length-1) <=0 ) {
+ newItem.setText(0, name);
+ newItem.setText(1, "");
+ }else{
+ String type =
name.split("\\.")[name.split("\\.").length-1].toString();
+ newItem.setText(0,name.substring(0,
(name.length()-type.length()-1)));
+ newItem.setText(1,type);
+ }
Map<String, String> metaData = entry.getMetadata();
if (entry.getEnvironment() != null) {
- newItem.setData(1, Qt.ItemDataRole.ToolTipRole, entry
+ newItem.setData(2, Qt.ItemDataRole.ToolTipRole, entry
.getEnvironment());
String env = entry.getEnvironment().replaceAll("\n", "");
- newItem.setText(1, env.substring(0, Math.min(50, env.length())));
+ newItem.setText(2, env.substring(0, Math.min(50, env.length())));
}
- newItem.setText(2, metaData.get("svn:entry:last-author"));
+ newItem.setText(3, metaData.get("svn:entry:last-author"));
newItem
- .setText(3, String
+ .setText(4, String
.format("%10s", metaData.get("auto:filesize")));
String date = metaData.get("svn:entry:committed-date").substring(0,
23)
.replace("T", " ");
// QDateTime d = QDateTime.fromString(date,
"yyyy-MM-ddTHH:mm:ss.zzz");
- newItem.setText(4, date);
- newItem.setText(5, String.format("%6s", entry.getVersion()));
+ newItem.setText(5, date);
+ newItem.setText(6, String.format("%6s", entry.getVersion()));
if (topLevelItem) {
return newItem;
- [idok-commit] idok commit r139 - trunk/java/ch/idok/qtgui, Apache, 07/07/2008
Archive powered by MHonArc 2.6.19.