[kune-commits] r1527 - in trunk/src: main/java/cc/kune/common/client/ui/dialogs/tabbed main/java/cc/kune/core/client/i18n main/java/cc/kune/core/client/state main/java/cc/kune/core/server main/java/cc/kune/core/server/rpc main/java/cc/kune/core/shared/dto main/java/cc/kune/gspace/client/options/general main/resources test/java/cc/kune/core/client/i18n

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Fri Sep 23 02:01:58 CEST 2011


Author: vjrj_
Date: 2011-09-23 02:01:57 +0200 (Fri, 23 Sep 2011)
New Revision: 1527

Modified:
   trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java
   trunk/src/main/java/cc/kune/core/client/i18n/I18nUtils.java
   trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java
   trunk/src/main/java/cc/kune/core/server/InitData.java
   trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java
   trunk/src/main/java/cc/kune/core/shared/dto/InitDataDTO.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPanel.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralView.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java
   trunk/src/main/resources/ConstantsTest_en.properties
   trunk/src/test/java/cc/kune/core/client/i18n/ConstantsTest.java
   trunk/src/test/java/cc/kune/core/client/i18n/I18nUtilsTest.java
Log:
CLOSED - # 68: Change your language and name in User Options 
http://kune.ourproject.org/issues/ticket/68

Modified: trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java	2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java	2011-09-23 00:01:57 UTC (rev 1527)
@@ -144,7 +144,7 @@
     }
     messageErrorBar = new MessageToolbar(images, errorLabelId);
     tabPanel = new TabLayoutPanel(25, Unit.PX);
-    tabPanel.addStyleName("oc-noselect");
+    // tabPanel.addStyleName("oc-noselect");
     dialog.getInnerPanel().add(tabPanel);
     tabPanel.addSelectionHandler(new SelectionHandler<Integer>() {
       @Override

Modified: trunk/src/main/java/cc/kune/core/client/i18n/I18nUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/I18nUtils.java	2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/java/cc/kune/core/client/i18n/I18nUtils.java	2011-09-23 00:01:57 UTC (rev 1527)
@@ -10,6 +10,7 @@
 
   public static String convertMethodName(final String name) {
     String result = name;
+    result = result.replaceAll("\\\n", " ");
     result = result.replaceAll("\\[%d\\]", "N");
     result = result.replaceAll("\\[%s\\]", "Param");
     final char[] delimiters = { ' ', '.', '?', ',', ';', '&', '(', ')', '"', '$', '!', '/', '\'', '-',

Modified: trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java	2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java	2011-09-23 00:01:57 UTC (rev 1527)
@@ -398,8 +398,11 @@
   @Override
   public void setRetrievedStateAndGo(final StateAbstractDTO newState) {
     setRetrievedState(newState);
-    // setState(newState);
-    history.newItem(newState.getStateToken().toString());
+    final String token = newState.getStateToken().toString();
+    if (history.getToken().equals(token)) {
+      setState(newState);
+    }
+    history.newItem(token);
   }
 
   @Override

Modified: trunk/src/main/java/cc/kune/core/server/InitData.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/InitData.java	2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/java/cc/kune/core/server/InitData.java	2011-09-23 00:01:57 UTC (rev 1527)
@@ -59,6 +59,7 @@
   private ReservedWordsRegistryDTO reservedWords;
   private String siteDomain;
   private String siteLogoUrl;
+  private String siteShortName;
   private String siteUrl;
   private String[] timezones;
   private UserInfo userInfo;
@@ -165,6 +166,10 @@
     return siteLogoUrl;
   }
 
+  public String getSiteShortName() {
+    return siteShortName;
+  }
+
   public String getSiteUrl() {
     return siteUrl;
   }
@@ -290,6 +295,10 @@
     this.siteLogoUrl = siteLogoUrl;
   }
 
+  public void setSiteShortName(final String siteShortName) {
+    this.siteShortName = siteShortName;
+  }
+
   public void setSiteUrl(final String siteUrl) {
     this.siteUrl = siteUrl;
   }

Modified: trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java	2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java	2011-09-23 00:01:57 UTC (rev 1527)
@@ -153,6 +153,7 @@
     data.setAviEmbedObject(kuneProperties.get(KuneProperties.AVI_EMBEDED_OBJECT));
     data.setExtMediaDescrips(extMediaDescManager.getAll());
     data.setFeedbackEnabled(kuneProperties.getBoolean(KuneProperties.FEEDBACK_ENABLED));
+    data.setSiteShortName(kuneProperties.get(KuneProperties.SITE_SHORTNAME));
     return data;
   }
 }

Modified: trunk/src/main/java/cc/kune/core/shared/dto/InitDataDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/InitDataDTO.java	2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/java/cc/kune/core/shared/dto/InitDataDTO.java	2011-09-23 00:01:57 UTC (rev 1527)
@@ -52,6 +52,7 @@
   private ReservedWordsRegistryDTO reservedWords;
   private String siteDomain;
   private String siteLogoUrl;
+  private String siteShortName;
   private String siteUrl;
   private String[] timezones;
   private UserInfoDTO userInfo;
@@ -161,6 +162,10 @@
     return siteLogoUrl;
   }
 
+  public String getSiteShortName() {
+    return siteShortName;
+  }
+
   public String getSiteUrl() {
     return siteUrl;
   }
@@ -290,6 +295,10 @@
     this.siteLogoUrl = siteLogoUrl;
   }
 
+  public void setSiteShortName(final String siteShortName) {
+    this.siteShortName = siteShortName;
+  }
+
   public void setSiteUrl(final String siteUrl) {
     this.siteUrl = siteUrl;
   }

Modified: trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPanel.java	2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPanel.java	2011-09-23 00:01:57 UTC (rev 1527)
@@ -64,4 +64,9 @@
     this.shortName.setValue(shortName);
   }
 
+  @Override
+  public void setShortNameEnabled(final boolean enabled) {
+    this.shortName.setEnabled(enabled);
+  }
+
 }

Modified: trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPresenter.java	2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPresenter.java	2011-09-23 00:01:57 UTC (rev 1527)
@@ -70,6 +70,7 @@
   @Override
   protected void setState() {
     final GroupDTO group = session.getCurrentState().getGroup();
+    groupView.setShortNameEnabled(!session.getInitData().getSiteShortName().equals(group.getShortName()));
     groupView.setShortName(group.getShortName());
     groupView.setLongName(group.getLongName());
   }

Modified: trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralView.java	2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralView.java	2011-09-23 00:01:57 UTC (rev 1527)
@@ -29,4 +29,6 @@
 
   void setShortName(String shortName);
 
+  void setShortNameEnabled(boolean enabled);
+
 }

Modified: trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java	2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java	2011-09-23 00:01:57 UTC (rev 1527)
@@ -82,7 +82,8 @@
       final UserSimpleDTO currentUser = session.getCurrentUser();
       final UserDTO user = new UserDTO();
       user.setId(currentUser.getId());
-      user.setName(userView.getLongName());
+      final String longName = userView.getLongName();
+      user.setName(longName);
       userService.get().updateUser(session.getUserHash(), user, userView.getLanguage(),
           new AsyncCallbackSimple<StateAbstractDTO>() {
             @Override

Modified: trunk/src/main/resources/ConstantsTest_en.properties
===================================================================
--- trunk/src/main/resources/ConstantsTest_en.properties	2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/resources/ConstantsTest_en.properties	2011-09-23 00:01:57 UTC (rev 1527)
@@ -4,4 +4,5 @@
 someMultipleLines = \
 some \
 multiple \
-lines
\ No newline at end of file
+lines
+someMultipleLinesWithCarriage = some\nmultiple\nlines\nwith\ncarriage
\ No newline at end of file

Modified: trunk/src/test/java/cc/kune/core/client/i18n/ConstantsTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/client/i18n/ConstantsTest.java	2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/test/java/cc/kune/core/client/i18n/ConstantsTest.java	2011-09-23 00:01:57 UTC (rev 1527)
@@ -51,4 +51,10 @@
     assertEquals("some multiple lines",
         english.getString(I18nUtils.convertMethodName("some multiple lines")));
   }
+
+  @Test
+  public void multipleLinesWithCarriageReturn() {
+    assertEquals("some\nmultiple\nlines\nwith\ncarriage",
+        english.getString(I18nUtils.convertMethodName("some\nmultiple\nlines\nwith\ncarriage")));
+  }
 }

Modified: trunk/src/test/java/cc/kune/core/client/i18n/I18nUtilsTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/client/i18n/I18nUtilsTest.java	2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/test/java/cc/kune/core/client/i18n/I18nUtilsTest.java	2011-09-23 00:01:57 UTC (rev 1527)
@@ -29,6 +29,11 @@
   }
 
   @Test
+  public void carriageReturn() {
+    assertEquals("yesNo", I18nUtils.convertMethodName("yes\nno"));
+  }
+
+  @Test
   public void testParams() {
     assertEquals("nOfParamItems", I18nUtils.convertMethodName("[%d] of [%s] items"));
     assertEquals("nOfNItems", I18nUtils.convertMethodName("[%d] of [%d] items"));




More information about the kune-commits mailing list