Implemented optional line wrapping.

This commit is contained in:
LoRd_MuldeR 2014-06-05 20:33:15 +02:00
parent f9f3c71071
commit 62b5ecf9f2
4 changed files with 30 additions and 14 deletions

View File

@ -239,6 +239,7 @@
<normaloff>:/res/ico_options.png</normaloff>:/res/ico_options.png</iconset>
</property>
<addaction name="actionShellExtension"/>
<addaction name="actionLineWrapping"/>
<addaction name="actionVerboseOutput"/>
</widget>
<addaction name="actionOpen"/>
@ -370,7 +371,15 @@
<bool>true</bool>
</property>
<property name="text">
<string>Enable Verbose Output</string>
<string>Enable Verbose/Debug Output</string>
</property>
</action>
<action name="actionLineWrapping">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Enable Line Wrapping</string>
</property>
</action>
</widget>

View File

@ -21,7 +21,7 @@
//Version
static unsigned int mixp_versionMajor = 2;
static unsigned int mixp_versionMinor = 10;
static unsigned int mixp_versionMinor = 11;
//MediaInfo Version
static unsigned int mixp_miVersionMajor = 0;

View File

@ -99,17 +99,18 @@ CMainWindow::CMainWindow(const QString &tempFolder, IPC *const ipc, QWidget *par
ui->actionLink_Discuss->setData(QVariant(QString::fromLatin1(LINK_DISCUSS)));
//Setup connections
connect(ui->analyzeButton, SIGNAL(clicked()), this, SLOT(analyzeButtonClicked()));
connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(analyzeButtonClicked()));
connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(saveButtonClicked()));
connect(ui->actionCopyToClipboard, SIGNAL(triggered()), this, SLOT(copyToClipboardButtonClicked()));
connect(ui->actionClear, SIGNAL(triggered()), this, SLOT(clearButtonClicked()));
connect(ui->actionLink_MuldeR, SIGNAL(triggered()), this, SLOT(linkTriggered()));
connect(ui->actionLink_MediaInfo, SIGNAL(triggered()), this, SLOT(linkTriggered()));
connect(ui->actionLink_Discuss, SIGNAL(triggered()), this, SLOT(linkTriggered()));
connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(showAboutScreen()));
connect(ui->actionShellExtension, SIGNAL(toggled(bool)), this, SLOT(updateShellExtension(bool)));
connect(m_ipc, SIGNAL(receivedStr(QString)), this, SLOT(fileReceived(QString)));
connect(ui->analyzeButton, SIGNAL(clicked()), this, SLOT(analyzeButtonClicked()));
connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(analyzeButtonClicked()));
connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(saveButtonClicked()));
connect(ui->actionCopyToClipboard, SIGNAL(triggered()), this, SLOT(copyToClipboardButtonClicked()));
connect(ui->actionClear, SIGNAL(triggered()), this, SLOT(clearButtonClicked()));
connect(ui->actionLink_MuldeR, SIGNAL(triggered()), this, SLOT(linkTriggered()));
connect(ui->actionLink_MediaInfo, SIGNAL(triggered()), this, SLOT(linkTriggered()));
connect(ui->actionLink_Discuss, SIGNAL(triggered()), this, SLOT(linkTriggered()));
connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(showAboutScreen()));
connect(ui->actionShellExtension, SIGNAL(toggled(bool)), this, SLOT(updateShellExtension(bool)));
connect(ui->actionLineWrapping, SIGNAL(toggled(bool)), this, SLOT(updateLineWrapping(bool)));
connect(m_ipc, SIGNAL(receivedStr(QString)), this, SLOT(fileReceived(QString)));
ui->versionLabel->installEventFilter(this);
//Context menu
@ -563,7 +564,7 @@ void CMainWindow::processFinished(void)
htmlData.replaceInStrings(QRegExp("^([^:<>]+)$"), "<b><font color=\"darkred\">\\1</font></b>"); //Heading lines
//Update document
ui->textBrowser->setHtml(QString("<pre>%1</pre>").arg(htmlData.join("<br>")));
ui->textBrowser->setHtml(QString("<pre style=\"white-space:pre-wrap\">%1</pre>").arg(htmlData.join("<br>")));
//Enable actions
if(!m_outputLines.empty())
@ -600,6 +601,11 @@ void CMainWindow::updateShellExtension(bool checked)
ShellExtension::setEnabled(checked);
}
void CMainWindow::updateLineWrapping(bool checked)
{
ui->textBrowser->setLineWrapMode(checked ? QTextEdit::WidgetWidth : QTextEdit::NoWrap);
}
void CMainWindow::linkTriggered(void)
{
QObject *obj = QObject::sender();

View File

@ -57,6 +57,7 @@ private slots:
void updateSize(void);
void initShellExtension(void);
void updateShellExtension(bool checked);
void updateLineWrapping(bool checked);
void fileReceived(const QString &path);
protected: