changes in xsl and css, 0 instead of NULL in code
authorPiotrek <ppilar11@gmail.com>
Tue, 7 Sep 2010 11:27:11 +0000 (13:27 +0200)
committerPiotrek <ppilar11@gmail.com>
Tue, 7 Sep 2010 11:27:11 +0000 (13:27 +0200)
data/xsl/style.css
data/xsl/xsl.xsl
src/mdictionary/gui/DictManagerWidget.cpp
src/mdictionary/gui/DictTypeSelectDialog.cpp
src/mdictionary/gui/DictTypeSelectDialog.h
src/mdictionary/gui/MenuTabWidget.cpp
src/mdictionary/gui/MenuTabWidget.h
src/mdictionary/gui/MenuWidget.cpp
src/plugins/xdxf/XdxfLoadDialog.cpp
src/plugins/xdxf/XdxfLoadDialog.h
src/plugins/xdxf/XdxfSettingsDialog.cpp

index c8490f2..24db5fb 100644 (file)
@@ -1,11 +1,34 @@
-th.info {
-       background-color       : #99FF99; 
+div.tab {
+       
+       border-style            : solid;
+       border-width            : thin;
+       width                   : 100%
 }
 
-th.key {
+div.info {
+        font-weight            : bold;
+        text-align             : center;
+        border-style           : solid;
+        border-width           : thin;
+        margin                 : 2px 2px 2px 2px;                 
+       background-color       : #99FF99;
+}
+
+div.key {
+       font-weight             : bold;
+       text-align              : center;
+       border-style            : solid;
+       border-width            : thin;
+       margin                  : 2px 2px 2px 2px;   
        background-color        : #99CCFF; 
 }
 
+div.cell {
+       border-style            : solid;
+       border-width            : thin;
+       margin                  : 2px 2px 2px 2px;
+}
+
 span.i {
         font-style             : italic;
 }
index 96770eb..01a19c4 100644 (file)
@@ -2,34 +2,28 @@
 <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
 <xsl:template match="/">
-                <table border="1" width="100%">
-                   <xsl:for-each select="ar/dict"> 
+       <div class="tab">
+               <xsl:for-each select="ar/dict"> 
                        <xsl:apply-templates/>
-                   </xsl:for-each>
-                </table>
+               </xsl:for-each>
+       </div>
 </xsl:template> 
 
 <xsl:template match="info">
-       <tr>
-               <th class="info">               
+       <div class="info">              
                <xsl:if test="@bookmark = 'true'">
                        <img src="$STAR$" width="16" height="16"/>   
                </xsl:if>
-               <xsl:value-of select="."/> <!-- <img src="{$path}"/> -->
-               </th>
-       </tr>
+               <xsl:value-of select="."/> 
+       </div>
 </xsl:template>
 
 <xsl:template match="key">
-       <tr>
-       <th class="key"><xsl:value-of select="."/></th>                 
-       </tr>
+       <div class="key"><xsl:value-of select="."/></div>                       
 </xsl:template> 
 
 <xsl:template match="t">
-       <tr>
-          <td><xsl:apply-templates/></td>
-        </tr>
+       <div class="cell"><xsl:apply-templates/></div>
 </xsl:template>
 
 <xsl:template match="tr">
        <br/>
 </xsl:template>
 
-<!--
-<xsl:template match="table">
-       <table>
-       <xsl:apply-templates/>
-       </table>
-</xsl:template>
-
-<xsl:template match="tr">
-       <tr>
-       <xsl:apply-templates/>
-       </tr>
-</xsl:template>
-
-<xsl:template match="td">
-       <td>
-       <xsl:apply-templates/>
-       </td>
-</xsl:template>        -->
-
 </xsl:stylesheet> 
index ba38115..c1f517d 100644 (file)
@@ -176,11 +176,11 @@ void DictManagerWidget::addNewDictButtonClicked() {
 
    CommonDictInterface* selectedPlugin =
            DictTypeSelectDialog::addNewDict(guiInterface->getPlugins(),this);
-   if(selectedPlugin != NULL) {
+   if(selectedPlugin) {
        Settings* settings =
                selectedPlugin->dictDialog()->addNewDictionary(this);
 
-       if(settings != NULL) {
+       if(settings) {
            CommonDictInterface* newDict = selectedPlugin->getNew(settings);
            if(newDict) {
                delete settings;
index 886a377..b03296b 100644 (file)
@@ -44,7 +44,7 @@ DictTypeSelectDialog::DictTypeSelectDialog(QList<CommonDictInterface *> plugins,
         pluginsListWidget->addItem(item);
     }
 
-    _selectedPlugin = NULL;
+    _selectedPlugin = 0;
 
     connect(pluginsListWidget, SIGNAL(itemClicked(QListWidgetItem*)),
             this, SLOT(pluginSelected(QListWidgetItem*)));
@@ -68,6 +68,6 @@ CommonDictInterface* DictTypeSelectDialog::addNewDict(
         return dictSelect.selectedPlugin();
     }
     else {
-        return NULL;
+        return 0;
     }
 }
index 11b1e0a..1bb725a 100644 (file)
@@ -44,7 +44,7 @@ public:
     /*!
       \param plugins list of loaded plugins
       \param parent widget
-      \return selected plugin, if user cancels dialog it returns NULL
+      \return selected plugin, if user cancels dialog it returns 0 (NULL)
       */
     static CommonDictInterface* addNewDict(
             QList<CommonDictInterface* > plugins,
index 30908e3..d9be263 100644 (file)
@@ -32,8 +32,8 @@ MenuTabWidget::MenuTabWidget(QWidget *parent) :
 
 
 void MenuTabWidget::hideEvent(QHideEvent *e) {
-    //just sets parent to null, and allows event to be handled by default handler
-    setParent(NULL);
+    //just sets parent to 0 (null), and allows event to be handled by default handler
+    setParent(0);
 
 
     QTabWidget::hideEvent(e);
index 3f625d4..464a2ec 100644 (file)
@@ -37,7 +37,7 @@ public:
 protected:
     /*!
       Reimplemented default hideEvent function.
-      Right before hiding widget it sets its parent to NULL, which prevents
+      Right before hiding widget it sets its parent to 0 (NULL), which prevents
       widget from being deleted by menu bar.
     */
     void hideEvent(QHideEvent *);
index f2d894a..07b8d2e 100644 (file)
@@ -61,7 +61,7 @@ void MenuWidget::removeSubMenu(QString title) {
 QWidget* MenuWidget::createWidget(QWidget *) {
     /*When we have request to create new widget we return tabWidget.
     When the menu is closing, tabWidget will receive hideEvent which will set
-    its parent to NULL and prevent it from delete, so we can still use this
+    its parent to 0 (NULL) and prevent it from delete, so we can still use this
     widget*/
     return tabWidget;
 
index 269bb87..83f29c3 100644 (file)
@@ -87,8 +87,8 @@ void XdxfLoadDialog::selectFile() {
                                      tr("Select dictionary file"),
                                      "",
                                      tr("XDXF Files (*.xdxf)"),
-                                     NULL,
-                                     NULL);
+                                     0,
+                                     0);
 
     if (!fileName.isEmpty()) {
         browseLabel->setText(tr("Dictionary file: %1").arg(fileName));
@@ -147,7 +147,7 @@ Settings* XdxfLoadDialog::getSettings(QWidget *parent) {
         return settings;
     }
 
-    return NULL;
+    return 0;
 }
 
 
index 97e79e5..a5161bf 100644 (file)
@@ -36,7 +36,7 @@ public:
     explicit XdxfLoadDialog(QWidget *parent = 0);
 
     /*! Displays dialog and returns settings of new dictionary
-        \return Settings object containing new dictionary settings or NULL in
+        \return Settings object containing new dictionary settings or 0 (NULL) in
         case user cancels dialog
     */
     static Settings* getSettings(QWidget *parent);
index 7143737..f9b4206 100644 (file)
@@ -129,8 +129,8 @@ void XdxfSettingsDialog::selectFile() {
                                      tr("Select dictionary file"),
                                      "",
                                      tr("XDXF Files (*.xdxf)"),
-                                     NULL,
-                                     NULL);
+                                     0,
+                                     0);
     if (!fileName.isEmpty()) {
         browseLabel->setText(tr("Dictionary file: ") + fileName);
         _dicitonaryFilePath = fileName;