[freenet-cvs] r19358 - in trunk/apps/thingamablog/src/net/sf/thingamablog: blog gui/app gui/properties transport

dieppe at freenetproject.org dieppe at freenetproject.org
Tue Apr 15 18:19:42 UTC 2008


Author: dieppe
Date: 2008-04-15 18:19:41 +0000 (Tue, 15 Apr 2008)
New Revision: 19358

Modified:
   trunk/apps/thingamablog/src/net/sf/thingamablog/blog/TBWeblog.java
   trunk/apps/thingamablog/src/net/sf/thingamablog/gui/app/ThingamablogFrame.java
   trunk/apps/thingamablog/src/net/sf/thingamablog/gui/properties/TBPublishTransportPanel.java
   trunk/apps/thingamablog/src/net/sf/thingamablog/transport/FCPTransport.java
Log:
Fix a bug which was already fixed, but not at the same place, and was 
causing some wierd editions number...
Add a "new flog" option when right clicking on the root of the 
[web/f]log list.
Minor refactoring.



Modified: trunk/apps/thingamablog/src/net/sf/thingamablog/blog/TBWeblog.java
===================================================================
--- trunk/apps/thingamablog/src/net/sf/thingamablog/blog/TBWeblog.java	2008-04-15 18:13:33 UTC (rev 19357)
+++ trunk/apps/thingamablog/src/net/sf/thingamablog/blog/TBWeblog.java	2008-04-15 18:19:41 UTC (rev 19358)
@@ -152,10 +152,12 @@
                 super.doFlogPublish(progress);
                 // Now we update the urls with the new edition number
                 String url = baseUrl;
+                int edition = ((FCPTransport) getPublishTransport()).getEdition() + 1;
+                String path = ((FCPTransport) getPublishTransport()).getSSKPath();
                 if(!url.endsWith("/"))
-                    url += "/";;
-                url = url.substring(0,url.length()-2);
-                url += ((FCPTransport) getPublishTransport()).getEdition() + "/";
+                    url += "/";
+                int firstSlash = url.indexOf('/');
+                url = url.substring(0,firstSlash+1) + "/" + path + "/" + edition + "/";                
                 setBlogUrls(basePath,url,url,url);
             }
 	}

Modified: trunk/apps/thingamablog/src/net/sf/thingamablog/gui/app/ThingamablogFrame.java
===================================================================
--- trunk/apps/thingamablog/src/net/sf/thingamablog/gui/app/ThingamablogFrame.java	2008-04-15 18:13:33 UTC (rev 19357)
+++ trunk/apps/thingamablog/src/net/sf/thingamablog/gui/app/ThingamablogFrame.java	2008-04-15 18:19:41 UTC (rev 19358)
@@ -2045,6 +2045,7 @@
 		{
 			blogTreePopup = new JPopupMenu();
 			blogTreePopup.add(newWeblogAction);
+                        blogTreePopup.add(newFlogAction);
 			initHTMLView(WeblogTreeModel.ROOT);
 			viewerPanelLayout.show(viewerPanel, HTML_VIEW);
 			return;//nothing to do	

Modified: trunk/apps/thingamablog/src/net/sf/thingamablog/gui/properties/TBPublishTransportPanel.java
===================================================================
--- trunk/apps/thingamablog/src/net/sf/thingamablog/gui/properties/TBPublishTransportPanel.java	2008-04-15 18:13:33 UTC (rev 19357)
+++ trunk/apps/thingamablog/src/net/sf/thingamablog/gui/properties/TBPublishTransportPanel.java	2008-04-15 18:19:41 UTC (rev 19358)
@@ -270,13 +270,12 @@
                             pt.setActiveLinkPath(fcpPanel.getActiveLinkPath());
                         }
                         String url = fcpPanel.getRequestUri();                        
+                        int edition = fcpPanel.getEditionNumber()+1;
+                        if (!url.endsWith("/"))
+                            url = url + "/";
                         int firstSlash = url.indexOf('/');
-                        if (firstSlash != -1) {
-                            // The url will be use for the next edition of the flog, so it must point to the next edition
-                            url = url.substring(0,firstSlash+1) + ASCIIconv.convertNonAscii(fcpPanel.getFlogSSKPath()) + "/" + (fcpPanel.getEditionNumber()+1) + "/";
-                        } else {
-                            url = url + "/" + ASCIIconv.convertNonAscii(fcpPanel.getFlogSSKPath()) + "/" + (fcpPanel.getEditionNumber()+1) + "/";
-                        }
+                        // The url will be use for the next edition of the flog, so it must point to the next edition
+                        url = url.substring(0,firstSlash+1) + fcpPanel.getFlogSSKPath() + "/" + edition + "/";
                         weblog.setBlogUrls("none",url,url,url);
                         pt.setEdition(fcpPanel.getEditionNumber());
                         pt.setSSKPath(fcpPanel.getFlogSSKPath());
@@ -608,7 +607,7 @@
         }
         
         public void setFlogSSKPath(String path){
-            this.flogSSKPath.setText(path);
+            this.flogSSKPath.setText(ASCIIconv.convertNonAscii(path));
         }
         
         private class TypeListener implements ActionListener {

Modified: trunk/apps/thingamablog/src/net/sf/thingamablog/transport/FCPTransport.java
===================================================================
--- trunk/apps/thingamablog/src/net/sf/thingamablog/transport/FCPTransport.java	2008-04-15 18:13:33 UTC (rev 19357)
+++ trunk/apps/thingamablog/src/net/sf/thingamablog/transport/FCPTransport.java	2008-04-15 18:19:41 UTC (rev 19358)
@@ -264,7 +264,7 @@
     }
     
     public void setSSKPath(String path){
-        this.SSKPath = path;
+        this.SSKPath = ASCIIconv.convertNonAscii(path);
     }
     
     private String shortenURI(String uri) {




More information about the cvs mailing list