Skip to Content.
Sympa Menu

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

idok-commit AT lists.psi.ch

Subject: Commit emails of the iDok project

List archive

[idok-commit] idok commit r129 - 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 r129 - trunk/java/ch/idok/qtgui
  • Date: Wed, 2 Jul 2008 12:29:02 +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: Wed Jul 2 12:29:01 2008
New Revision: 129

Log:
Fixed The following bugs:

-(IDO-186) Connect to a repository by pressing the "ENTER" key instead of
using the "Connect" button

-(IDO-187) No entry in the preference file after connecting to a new
repository via the "Connect" button



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

Modified: trunk/java/ch/idok/qtgui/RepositoryController.java
==============================================================================
--- trunk/java/ch/idok/qtgui/RepositoryController.java (original)
+++ trunk/java/ch/idok/qtgui/RepositoryController.java Wed Jul 2 12:29:01
2008
@@ -21,6 +21,7 @@

import java.net.URI;
import java.net.URISyntaxException;
+import java.util.ArrayList;

import ch.idok.common.errorhandling.DmsException;
import ch.idok.common.impl.repository.svn.SvnRepositoryManager;
@@ -77,8 +78,9 @@
public RepositoryController(Ui_DmsMainWindow ui, GuiClientHandler
handler) {
ui_ = ui;
mgr_ = new SvnRepositoryManager(handler);
+ ui.urlPushButton.clicked.connect(this, "activateComboBox()");
ui.urlPushButton.clicked.connect(this, "connectRepository()");
-
+ ui.urlComboBox.activated.connect(this, "connectRepository()");
// allow to edit list by right clicking on it
uiList_ = new Ui_ListSelectionDialog();
listDialog_ = new QDialog();
@@ -95,6 +97,14 @@
setupPreferences();

}
+
+
+ public final void activateComboBox() {
+ if (ui_.urlComboBox.findText(ui_.urlComboBox.currentText()) == -1) {
+ ui_.urlComboBox.addItem(ui_.urlComboBox.currentText());
+ }
+
+ }

public final String getRepositoryUrl() {
return ui_.urlComboBox.currentText();
@@ -138,6 +148,7 @@
ui_.statusbar.showMessage("Connecting to repository ");
tryConnecting.emit();
QApplication.processEvents();
+ int newEntry = 0;

try {
repoURI = URIUtil.parseUserURI(getRepositoryUrl());
@@ -146,10 +157,20 @@
.getPath();
projectName_ = path.split("/")[1];
repoName_ = path.split("/")[2];
- DmsGui.Settings.setValue("/repo" + getRepositoryNumber(),
- getRepositoryUrl());
- DmsGui.Settings.setValue("lastUsedRepo", getRepositoryNumber());
- DmsGui.Settings.sync();
+ // ui_.urlComboBox.setCurrentIndex(ui_.urlComboBox.count());$
+ // DmsGui.Settings.setValue("/repo" + getRepositoryNumber(),
+ // getRepositoryUrl());
+ // DmsGui.Settings.setValue("lastUsedRepo",
getRepositoryNumber());
+
+ ArrayList<String> plist = new ArrayList<String>();
+ plist = getPreferences();
+ if (!plist.contains(ui_.urlComboBox.currentText())) {
+ newEntry = plist.size();
+ DmsGui.Settings
+ .setValue("/repo" + newEntry, getRepositoryUrl());
+ DmsGui.Settings.setValue("lastUsedRepo", newEntry);
+ DmsGui.Settings.sync();
+ }

// emit that the connection was succesful
connectionSuccesful.emit();
@@ -216,6 +237,22 @@
}

/**
+ * Returns a list containing the elements in the preference settings
+ */
+ private ArrayList getPreferences() {
+ // fill URL preference value into combobox
+ int i = 0;
+ ArrayList li = new ArrayList<String>();
+ Object o = DmsGui.Settings.value("repo0");
+ while (o != null) {
+ li.add(i, o.toString());
+ i++;
+ o = DmsGui.Settings.value("/repo" + i);
+ }
+ return li;
+ }
+
+ /**
* Allows to remove entries from repository preference list
*
* @param p



  • [idok-commit] idok commit r129 - trunk/java/ch/idok/qtgui, Apache, 07/02/2008

Archive powered by MHonArc 2.6.19.

Top of Page