Commit 24d8fb9c authored by floreal797's avatar floreal797

images and any component can be printonly or noprint, minutes times have interval of 5

parent 77e17647
......@@ -24,5 +24,7 @@
<file>images/logo_blanc.png</file>
<file>images/logo-grand_blanc.png</file>
<file>images/QCeCWriter.png</file>
<file>images/print.png</file>
<file>images/noprint.png</file>
</qresource>
</RCC>
This diff is collapsed.
......@@ -37,11 +37,13 @@
#include <QDir>
#include <QFileDialog>
#include <QFontDatabase>
#include <QInputDialog>
#include <QKeyEvent>
#include <QHBoxLayout>
#include <QList>
#include <QListView>
#include <QMap>
#include <qmath.h>
#include <QMessageBox>
#include <QPainter>
#include <QPixmap>
......@@ -163,6 +165,16 @@ private slots:
void on_actionRechercher_une_mise_jour_triggered();
void on_noPrint_clicked();
void on_printOnly_clicked();
void on_minPrep_editingFinished();
void on_minCuis_editingFinished();
void on_minRep_editingFinished();
public slots:
void init();
void config();
......@@ -195,6 +207,7 @@ private:
QString balise; //Stores the tag that will be deleted
QStringList balises; //Stores tags that will be deleted
int resetPosCaret; //Stores position of the cursot at which we must set cursor after deleting tags
int roundValueToFive(double value);
private:
void closeEvent (QCloseEvent *event);
......
......@@ -357,6 +357,9 @@ left: 10px; padding: 0 3px;}</string>
<property name="maximum">
<number>59</number>
</property>
<property name="singleStep">
<number>5</number>
</property>
</widget>
<widget class="QSpinBox" name="minCuis">
<property name="geometry">
......@@ -370,6 +373,9 @@ left: 10px; padding: 0 3px;}</string>
<property name="maximum">
<number>59</number>
</property>
<property name="singleStep">
<number>5</number>
</property>
</widget>
<widget class="QLabel" name="label_8">
<property name="geometry">
......@@ -432,6 +438,9 @@ left: 10px; padding: 0 3px;}</string>
<property name="maximum">
<number>59</number>
</property>
<property name="singleStep">
<number>5</number>
</property>
</widget>
<widget class="QLabel" name="label_10">
<property name="geometry">
......@@ -749,13 +758,13 @@ left: 10px; padding: 0 3px;}s</string>
<widget class="QGroupBox" name="groupBox_4">
<property name="minimumSize">
<size>
<width>471</width>
<width>651</width>
<height>31</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>471</width>
<width>651</width>
<height>31</height>
</size>
</property>
......@@ -795,7 +804,7 @@ left: 10px; padding: 0 3px;}</string>
<widget class="QPushButton" name="italicButton">
<property name="geometry">
<rect>
<x>60</x>
<x>50</x>
<y>0</y>
<width>41</width>
<height>31</height>
......@@ -817,7 +826,7 @@ left: 10px; padding: 0 3px;}</string>
<widget class="QPushButton" name="soulignButton">
<property name="geometry">
<rect>
<x>110</x>
<x>90</x>
<y>0</y>
<width>41</width>
<height>31</height>
......@@ -840,7 +849,7 @@ left: 10px; padding: 0 3px;}</string>
<widget class="QPushButton" name="commButton">
<property name="geometry">
<rect>
<x>160</x>
<x>140</x>
<y>0</y>
<width>41</width>
<height>31</height>
......@@ -872,7 +881,7 @@ left: 10px; padding: 0 3px;}</string>
<widget class="QPushButton" name="lienButton">
<property name="geometry">
<rect>
<x>210</x>
<x>190</x>
<y>0</y>
<width>81</width>
<height>31</height>
......@@ -904,7 +913,7 @@ left: 10px; padding: 0 3px;}</string>
<widget class="QPushButton" name="imgButton">
<property name="geometry">
<rect>
<x>300</x>
<x>280</x>
<y>0</y>
<width>81</width>
<height>31</height>
......@@ -936,7 +945,7 @@ left: 10px; padding: 0 3px;}</string>
<widget class="QPushButton" name="abcButton">
<property name="geometry">
<rect>
<x>390</x>
<x>370</x>
<y>0</y>
<width>71</width>
<height>31</height>
......@@ -965,6 +974,40 @@ left: 10px; padding: 0 3px;}</string>
</size>
</property>
</widget>
<widget class="QPushButton" name="noPrint">
<property name="geometry">
<rect>
<x>450</x>
<y>0</y>
<width>88</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>NoPrint</string>
</property>
<property name="icon">
<iconset resource="Ressources.qrc">
<normaloff>:/images/noprint.png</normaloff>:/images/noprint.png</iconset>
</property>
</widget>
<widget class="QPushButton" name="printOnly">
<property name="geometry">
<rect>
<x>540</x>
<y>0</y>
<width>101</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>PrintOnly</string>
</property>
<property name="icon">
<iconset resource="Ressources.qrc">
<normaloff>:/images/print.png</normaloff>:/images/print.png</iconset>
</property>
</widget>
</widget>
</item>
<item>
......@@ -1002,7 +1045,7 @@ left: 10px; padding: 0 3px;}</string>
<x>0</x>
<y>0</y>
<width>673</width>
<height>641</height>
<height>638</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
......@@ -1235,7 +1278,7 @@ left: 10px; padding: 0 3px;}</string>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>23</height>
<height>30</height>
</size>
</property>
<property name="styleSheet">
......@@ -1334,7 +1377,7 @@ left: 10px; padding: 0 3px;}</string>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>23</height>
<height>30</height>
</size>
</property>
</widget>
......@@ -1788,7 +1831,7 @@ left: 10px; padding: 0 3px;}</string>
<x>0</x>
<y>0</y>
<width>1149</width>
<height>23</height>
<height>26</height>
</rect>
</property>
<widget class="QMenu" name="menuOutils">
......
......@@ -632,13 +632,19 @@ QString Functions::insertLinks(QString data)
*/
QString Functions::insertPictures(QString data)
{
QRegExp exp ("\\[IMG:.+\\]");
QRegExp exp ("\\[IMG:(\\w+):([^\\]]+)\\]");
while (data.contains(exp))
{
QString img = exp.cap();
data.replace(img, "<img src=\"" + dirDistPict + img.mid(5, img.length() - 6).split("/").last() + "\" alt=\"Image d'illustration\" /><br/>");
if (!otherPicts.contains(img.mid(5, img.length() - 6)))
otherPicts.append(img.mid(5, img.length() - 6));
QString imgBal = exp.cap(0);
QString className = exp.cap(1);
QString img = exp.cap(2);
QString classDef = "";
if (className != "all") {
classDef = " class=\"" + className + "\"";
}
data.replace(imgBal, "<img src=\"" + dirDistPict + img.split("/").last() + "\" alt=\"Image d'illustration\"" + classDef + " /><br/>");
if (!otherPicts.contains(img))
otherPicts.append(img);
}
return data;
}
......@@ -682,6 +688,20 @@ QStringList Functions::makeTimes(int hPrep, int minPrep, int hCuis, int minCuis,
return res;
}
/**
* @brief Replace user tags NP and OP with html span tags
* @param text with user tags
* @return text with html span tags
*/
QString Functions::setPrintTags(QString text)
{
text = text.replace("<np>", "<span class=\"noprint\">");
text = text.replace("<po>", "<span class=\"printonly\">");
text = text.replace("</np>", "</span>");
text = text.replace("</po>", "</span>");
return text;
}
/**
* @brief Functions::generateHtmlCode
* @param titre
......@@ -765,6 +785,8 @@ QString Functions::generateHtmlCode(QString titre, QString mainPicture, int hPre
//Replace oe by "e dans l'o", because we speak French :
htmlCode = htmlCode.replace("oe", "&oelig;");
htmlCode = setPrintTags(htmlCode);
return htmlCode;
}
......
......@@ -70,6 +70,7 @@ public:
static QString makeExcerpt(QStringList descWords, QString tpsPrep, QString tpsCuis, QString tpsRep);
static bool copyRecursively(const QString &srcFilePath, const QString &tgtFilePath);
static bool removeDir(const QString &dirName);
static QString setPrintTags(QString text);
};
#endif // FUNCTIONS_H
......@@ -12,6 +12,7 @@
<!-- Stylesheet & Favicon -->
<link rel="icon" type="image/png" href="http://www.conseilsencuisine.fr/images/favicon1.ico" />
<link rel="stylesheet" type="text/css" href="wp-content/themes/CeC-theme/style.css" />
<link rel="stylesheet" type="text/css" href="wp-content/themes/CeC-theme/style-cec.css" />
<!-- WP Head -->
<link rel="alternate" type="application/rss+xml" title="Conseils en Cuisine ! &raquo; Crêpes salées Maquereau et Fondue de Poireaux Flux des commentaires" href="#" />
......
......@@ -23,6 +23,7 @@ $options = get_option( 'gopress_theme_settings' );
<link rel="icon" type="image/png" href="<?php echo $options['favicon']; ?>" />
<?php } ?>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/style-cec.css" />
<!-- WP Head -->
<?php if ( is_single() || is_page() ) wp_enqueue_script( 'comment-reply' ); ?>
......@@ -80,4 +81,4 @@ $options = get_option( 'gopress_theme_settings' );
'fallback_cb' => 'default_menu'
)); ?>
</div>
<!-- END navigation -->
\ No newline at end of file
<!-- END navigation -->
body {
text-align: justify;
}
.shadow {
-moz-box-shadow: 2px 2px 5px #888;
-webkit-box-shadow: 2px 2px 5px #888;
box-shadow:2px 2px 3px #888;
}
#detail {
clear: both;
overflow: hidden; /* Précaution pour IE 7 */
}
.lbold {
font-weight: bold;
color: #6B6B6B;
}
li span {
font-weight: normal;
color: black;
}
ol.lbold li {
margin: 10px 0px;
}
.printonly {
display: none;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment