I have found a couple of minor problems.

Files that use the plucker: 'protocol' (and aren't plucker:/home.html or
plucker:/channels/<SECTION>/home.html) are indicated as website URLs. Seems
to be more correct to call them local files.

Fix:

--- plucker_desktop.orig/channel_dialog.cpp     Sat Nov 17 16:32:22 2001
+++ plucker_desktop/channel_dialog.cpp  Sat Nov 17 18:18:17 2001
@@ -150,8 +150,8 @@
            home_url.Contains( "home.html" ) ) ) {    
         XMLCTRL( *the_channel_dialog, "channel_dialog_start_tab_links_radiobutton", 
wxRadioButton )
             ->SetValue( TRUE );    
-    // Else a file: protocol ( NULL argument tells not to store the remaining string 
anywhere )
-    } else if ( home_url.StartsWith( "file:", NULL ) ) {    
+    // Else a file: or plucker: protocol
+    } else if ( home_url.StartsWith( "file:" ) || home_url.StartsWith( "plucker:" ) ) 
+{    
         XMLCTRL( *the_channel_dialog, "channel_dialog_start_tab_file_radiobutton", 
wxRadioButton )
             ->SetValue( TRUE );   
         XMLCTRL( *the_channel_dialog, "channel_dialog_start_tab_file_textctrl", 
wxTextCtrl )


If you (manually) have set home_url to "plucker:/home.html" for a section
it will be indicated as a "A list of my links:", but you will not be able
to edit those links, since the tool is hard-coded to only look in the
channels dir.

Fix:

--- plucker_desktop.orig/editor_dialog.cpp      Mon Nov 12 21:32:56 2001
+++ plucker_desktop/editor_dialog.cpp   Sat Nov 17 18:18:41 2001
@@ -68,7 +68,7 @@
 
 void init_a_editor_dialog( wxWindow* parent, wxString configuration_section )
 {
-    wxString string;
+    wxString home_url;
     
     the_editor_dialog = new editor_dialog; 
     wxTheXmlResource->LoadDialog( the_editor_dialog, parent, "editor_dialog" );
@@ -81,14 +81,20 @@
     XMLCTRL( *the_editor_dialog, "editor_dialog_edit_tab_textctrl", wxTextCtrl 
)->SetFont( font );
     
     // Load the HTML code from file into the text control, ready for editing.
-    string = get_plkr_directory( CHANNELS ) <<'/' << configuration_section << '/' << 
"home.html";
+    home_url = the_configuration->Read( "home_url", _T( "" ) );    
+
+    // If no url specified: must be the default plucker home.html HTML page
+    if ( home_url == "" || home_url == "plucker:/home.html" )
+        home_url = get_plkr_directory( PLUCKERHOME ) << "/home.html";
+    else
+        home_url = get_plkr_directory( CHANNELS ) << '/' << configuration_section << 
+"/home.html";
     
     XMLCTRL( *the_editor_dialog, "editor_dialog_edit_tab_textctrl", wxTextCtrl )
-        ->LoadFile( string );
+        ->LoadFile( home_url );
     
-    // Store passed channel directory as a class global so the editor dialog knows 
where to
+    // Store home_url as a class global so the editor dialog knows where to
     // save it when closing.
-    the_editor_dialog->configuration_section = configuration_section;
+    the_editor_dialog->home_url = home_url;
     
     // Robert: unfortunately, can't seem to changing dialog style (to a resizable)
     // after creation, Calling a Refresh() might help.
@@ -135,11 +141,11 @@
     //Only bother saving if the text inside the textbox has been modified.
     if ( XMLCTRL( *the_editor_dialog, "editor_dialog_edit_tab_textctrl", wxTextCtrl 
)->IsModified() ) {     
         // Save the HTML code from the text control, back into the file.
-        // Recall "the_editor_dialog->configuration_section" was the section name 
that we
+        // Recall "the_editor_dialog->home_url" was the home.html file that we
         // squirreld away when we first opened this dialog.
-        string = get_plkr_directory( CHANNELS ) << '/'<< 
the_editor_dialog->configuration_section << '/' << "home.html";
+    
         bool successful = XMLCTRL( *the_editor_dialog, 
"editor_dialog_edit_tab_textctrl", wxTextCtrl )
-            ->SaveFile( string );        
+            ->SaveFile( the_editor_dialog->home_url );        
         // Show a warning message if unable to save.
         if( ! successful ) {
             wxLogError( _T( "Unable to save home.html") );

--- plucker_desktop.orig/editor_dialog.h        Mon Nov 12 21:32:56 2001
+++ plucker_desktop/editor_dialog.h     Sat Nov 17 18:18:41 2001
@@ -30,8 +30,8 @@
     
     // Override base class functions
     void OnOK( wxCommandEvent& event );
-    // Store the channel's config section for when time to write the file.
-    wxString configuration_section;
+    // Store the channel's home_url for when time to write the file.
+    wxString home_url;
 private:
     DECLARE_EVENT_TABLE()
 };


Also, it would be nice if it was possible to edit all local files using
the HTML editor.

/Mike

Reply via email to