Skip to content

Commit

Permalink
Merge pull request #221 from UDAAN-LEAP/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Ashish2831 authored Jan 11, 2023
2 parents 9eacef5 + 772508f commit 33d02bb
Show file tree
Hide file tree
Showing 17 changed files with 10,073 additions and 1,121 deletions.
4 changes: 4 additions & 0 deletions FrameWorkCode/AppResources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<file>spinbar-white-tp.gif</file>
<file>PDF-Preview.png</file>
<file>Resources/logonew.png</file>
<file>Resources/Old Icons/rotate.png</file>
</qresource>
<qresource prefix="/WordList">
<file>wordlists/english.txt</file>
Expand All @@ -63,5 +64,8 @@
<file>fonts/Latha/latha.ttf</file>
<file>fonts/Nirmala/Nirmala Regular.ttf</file>
<file>fonts/Chandas/chandas.ttf</file>
<file>fonts/Gujrati_Saral-1/Gujrati-Saral-1.ttf</file>
<file>fonts/shruti_regular/shruti.ttf</file>
<file>fonts/SolaimanLipi/SolaimanLipi.ttf</file>
</qresource>
</RCC>
5 changes: 5 additions & 0 deletions FrameWorkCode/Project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,11 @@ bool Project::push(QString gDirTwoLevelUp) {
std::cout<<3<<endl;
//goto cleanup;
}
if(git_index_has_conflicts(index)){
qDebug()<<"merge conflict";
QMessageBox::information(0, "CONFLICT (content)", "Automatic merge failed; fix conflicts and then save the result. Exiting because of an unresolved conflict.");
return false;
}

/* Commit the merge and cleanup repo state
*/
Expand Down
Binary file added FrameWorkCode/Resources/Old Icons/rotate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FrameWorkCode/Resources/rotate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file added FrameWorkCode/fonts/shruti_regular/shruti.ttf
Binary file not shown.
46 changes: 32 additions & 14 deletions FrameWorkCode/handlebbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,25 @@ QTextDocument *HandleBbox::loadFileInDoc(QFile *f)
QString line;
int flag_ = 0, nestedListCount = 0;
QString inputText = "";
QString isPrevUl = "no", isPrevOl = "no";
while(!f->atEnd()) {
line = f->readLine();
line = line.simplified();
QStringList l = line.split(" ");
for(int i = 0; i < l.size(); i++) {
//for parsing p tags
if((l[i].contains("<p") && flag_ != 2) || flag_ == 1){
if((l[i].contains("<p") && flag_ != 2 && flag_ != 5 && flag_ != 6) || flag_ == 1){
flag_ = 1;
while(i < l.size() && !l[i].contains("</p>")){
inputText += l[i];
inputText += " ";
i++;
while(i < l.size() && !l[i].contains("</p>")){
inputText += l[i];
inputText += " ";
i++;
}
if(i == l.size())
i = i - 1;
if(l[i].contains("</p>")){
flag_ = 0;
isPrevOl = isPrevUl = "no";
inputText += l[i];
inputText += " ";
inputText = latex2png(inputText);
Expand All @@ -94,13 +96,15 @@ QTextDocument *HandleBbox::loadFileInDoc(QFile *f)
blockFormat.setAlignment(Qt::AlignLeft);
}
cur.insertBlock();
inputText.replace("\\t","&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
cur.insertHtml(inputText);
cur.setBlockFormat(blockFormat);
inputText = "";
}
}

//for parsing table tags
else if(l[i].contains("<table") || flag_ == 2){
else if((l[i].contains("<table") && flag_ != 5 && flag_ != 6) || flag_ == 2){
flag_ = 2;
while(i < l.size() && !l[i].contains("</table>")){
inputText += l[i];
Expand All @@ -111,6 +115,7 @@ QTextDocument *HandleBbox::loadFileInDoc(QFile *f)
i = i - 1;
if(l[i].contains("</table>")){
flag_ = 0;
isPrevOl = isPrevUl = "no";
int num = doc->blockCount();
inputText += l[i];
inputText += " ";
Expand All @@ -128,6 +133,7 @@ QTextDocument *HandleBbox::loadFileInDoc(QFile *f)
blockFormat.setAlignment(Qt::AlignLeft);
}
cur.insertBlock();
inputText.replace("\\t","&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
cur.insertHtml(inputText);
cur2 = QTextCursor(doc->findBlockByNumber(num));
cur2.select(QTextCursor::BlockUnderCursor);
Expand All @@ -140,7 +146,7 @@ QTextDocument *HandleBbox::loadFileInDoc(QFile *f)
}

//for parsing image tags
else if(l[i].contains("<img") || flag_ == 3){
else if((l[i].contains("<img") && flag_ != 5 && flag_ != 6) || flag_ == 3){
flag_ = 3;
while(i < l.size() && !l[i].contains(">")){
inputText += l[i];
Expand All @@ -151,6 +157,7 @@ QTextDocument *HandleBbox::loadFileInDoc(QFile *f)
i = i - 1;
if(l[i].contains(">")){
flag_ = 0;
isPrevOl = isPrevUl = "no";
inputText += l[i];
inputText += " ";
cur.insertBlock();
Expand Down Expand Up @@ -183,13 +190,19 @@ QTextDocument *HandleBbox::loadFileInDoc(QFile *f)
}
if(l[i].contains("</ul>") && nestedListCount < 1){
flag_ = 0;
isPrevOl = "no";
inputText = latex2png(inputText);
int num = doc->blockCount();
cur.insertBlock();
inputText.replace("\\t","&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
cur.insertHtml(inputText);
cur2 = QTextCursor(doc->findBlockByNumber(num));
cur2.select(QTextCursor::BlockUnderCursor);
cur2.deleteChar();
if(isPrevUl == "no")
{
cur2 = QTextCursor(doc->findBlockByNumber(num));
cur2.select(QTextCursor::BlockUnderCursor);
cur2.deleteChar();
}
isPrevUl = "yes";
inputText = "";
}
}
Expand All @@ -213,13 +226,19 @@ QTextDocument *HandleBbox::loadFileInDoc(QFile *f)
}
if(l[i].contains("</ol>") && nestedListCount < 1){
flag_ = 0;
isPrevUl = "no";
inputText = latex2png(inputText);
int num = doc->blockCount();
cur.insertBlock();
inputText.replace("\\t","&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
cur.insertHtml(inputText);
cur2 = QTextCursor(doc->findBlockByNumber(num));
cur2.select(QTextCursor::BlockUnderCursor);
cur2.deleteChar();
if(isPrevOl == "no")
{
cur2 = QTextCursor(doc->findBlockByNumber(num));
cur2.select(QTextCursor::BlockUnderCursor);
cur2.deleteChar();
}
isPrevOl = "yes";
inputText = "";
}
}
Expand All @@ -229,7 +248,6 @@ QTextDocument *HandleBbox::loadFileInDoc(QFile *f)
inputText += "\n";
}
}

cur = QTextCursor(doc->findBlockByNumber(0));
cur.select(QTextCursor::BlockUnderCursor);
cur.deleteChar();
Expand Down
2 changes: 1 addition & 1 deletion FrameWorkCode/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ int main(int argc, char *argv[])
a.setWindowIcon(windowIcon); //Sets icon of the GUI window.
a.setStyleSheet("QMessageBox{font: 15px \"Work Sans\"; background:rgb(32, 33, 72);} QMessageBox QLabel{color:white;} QMessageBox QPushButton{background-color:rgb(227, 228, 228);border:0px; color: rgb(32, 33, 72); height:26.96px; width: 113.5px; padding-top:1px; border-radius:4.8px; padding-left:1.3px; selection-color: rgb(32, 33, 72); selection-background-color: rgb(136, 138, 133);} QMessageBox QPushButton:checked{background-color: rgb(136, 138, 133);} QMessageBox QPushButton:pressed {background-color: rgb(136, 138, 133);}");
a.setApplicationName( QStringLiteral( "Udaan Editing Tool" ) );
a.setApplicationVersion("v3.5.4");
a.setApplicationVersion("v3.5.6");
a.setAttribute(Qt::AA_EnableHighDpiScaling);

//! Writing Log Files
Expand Down
Loading

0 comments on commit 33d02bb

Please sign in to comment.