Patch #1115 2006-06-09 15:07

kkez

StartHere page rewritten and history always visible
Download
1115-StartHere_page.patch (7.4 KB)
Category
 
Status
Accepted
Close date
2006-06-14 09:17
Assigned to
 
Index: src/src/main.cpp
===================================================================
--- src/src/main.cpp    (revision 2541)
+++ src/src/main.cpp    (working copy)
@@ -1440,30 +1440,35 @@
     wxString buf = event.GetString();
     wxString links;
 
+    links << _T("<b>Recent projects</b><br>\n");
     if (m_ProjectsHistory.GetCount())
     {
-        links << _T("<b>Recent projects</b><br>\n");
         for (int i = 0; i < 9; ++i)
         {
             if (i >= (int)m_ProjectsHistory.GetCount())
                 break;
-            links << wxString::Format(_T("<a href=\"CB_CMD_OPEN_HISTORY_PROJECT_%d\">%s</a><br>\n"),
+            links << wxString::Format(_T("&bull; <a href=\"CB_CMD_OPEN_HISTORY_PROJECT_%d\">%s</a><br>\n"),
                                         i + 1, m_ProjectsHistory.GetHistoryFile(i).c_str());
         }
     }
+    else
+        links << _T("&nbsp;&nbsp;&nbsp;&nbsp;No recent projects<br>\n");
 
+    links << _T("<br><b>Recent files</b><br>\n");
     if (m_FilesHistory.GetCount())
     {
-        links << _T("<br><b>Recent files</b><br>\n");
         for (int i = 0; i < 9; ++i)
         {
             if (i >= (int)m_FilesHistory.GetCount())
                 break;
-            links << wxString::Format(_T("<a href=\"CB_CMD_OPEN_HISTORY_FILE_%d\">%s</a><br>\n"),
+            links << wxString::Format(_T("&bull; <a href=\"CB_CMD_OPEN_HISTORY_FILE_%d\">%s</a><br>\n"),
                                         i + 1, m_FilesHistory.GetHistoryFile(i).c_str());
         }
     }
+    else
+        links << _T("&nbsp;&nbsp;&nbsp;&nbsp;No recent files<br>\n");
 
+
     // update page
     buf.Replace(_T("CB_VAR_RECENT_FILES_AND_PROJECTS"), links);
     ((StartHerePage*)sh)->SetPageContent(buf);
Index: src/src/resources/start_here/start_here.html
===================================================================
--- src/src/resources/start_here/start_here.html    (revision 2541)
+++ src/src/resources/start_here/start_here.html    (working copy)
@@ -1,75 +1,58 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
     <title></title>
+    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
     <style type="text/css">
-      a {  background-color: inherit;  color: blue;  }
-      a:visited {  background-color: inherit;  color: blue;  }
+        a {  background-color: inherit;  color: blue;  }
+        a:visited {  background-color: inherit;  color: blue;  }
+        img { border: 0px }
     </style>
-  </head>
-  <body>
+</head>
+
+<body>
     <div align="center">
-      <a href="http://www.codeblocks.org/"><img style="border: 0px solid;" alt="" src="title.png" /></a><br />
-      <a href="rev"><font color="#9999df"><small>CB_VAR_REVISION_INFO</small></font></a><br />
-      <br />
-      <table border="0">
-        <tbody>
-          <tr>
-            <td>
-              <table border="0">
-                <tbody>
-                  <tr>
-                    <td width="56"><a href="CB_CMD_NEW_PROJECT"><img style="border: 0px solid; width: 47px; height: 42px;" alt="" src="new.png" /></a></td>
-                    <td><a href="CB_CMD_NEW_PROJECT">Create a new project</a></td>
-                  </tr>
-                  <tr>
-                    <td><a href="CB_CMD_OPEN_PROJECT"><img style="border: 0px solid; width: 47px; height: 47px;" alt="" src="open.png" /></a></td>
-                    <td><a href="CB_CMD_OPEN_PROJECT">Open an existing project</a></td>
-                  </tr>
-                </tbody>
-              </table>
-            </td>
-            <td rowspan="3">
-              <table border="0">
-                <tbody>
-                  <tr>
-                    <td width="58"><img style="border: 0px solid;" alt="" src="reopen.png" /></td>
-                    <td>CB_VAR_RECENT_FILES_AND_PROJECTS</td>
-                  </tr>
-                </tbody>
-              </table>
-            </td>
-          </tr>
-          <tr>
-            <td></td>
-          </tr>
-          <tr>
-            <td>
-              <table width="300">
-                <tbody>
-                  <tr>
-                    <td width="56" rowspan="4"><img style="border: 0px solid;" alt="" src="www.png" /></td>
-                  </tr>
-                  <tr>
-                    <td><a href="http://forums.codeblocks.org/">Visit the Code::Blocks forums</a></td>
-                  </tr>
-                  <tr>
-                    <td><a href="http://developer.berlios.de/bugs/?func=addbug&amp;group_id=5358">Report a bug</a></td>
-                  </tr>
-                  <tr>
-                    <td>
download for full patch...
kkez 2006-06-09 15:15

What does this patch do:

1) It always show the history, even if no file is present. (before there was only the image if there was no history file)

2) In order to make history look better with the changes at point 1), i've rewritten the start_here.html page with less code and some fix (<xml> tag at beginning?), and it still validates with w3c :)

kkez 2006-06-10 22:41

Oh, wait, that is XHTML :\ lol

Well, hope it doesn't matter if it's written in HTML or in XHTML...

Anyway, i've revised my patch, and now it's really w3c compliant (HTML). I've already tested it in my build and it looks ok.

About the code, i wanted to use width="50%" for the two tables, but it seems that the wxwidget parser doesn't handle it right... so i sticked to a fixed width, that is needed to avoid the text to wrap.

Hope you'll apply because the reopen.png alone doesn't look good :)