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> <normaloff>:/res/ico_options.png</normaloff>:/res/ico_options.png</iconset>
</property> </property>
<addaction name="actionShellExtension"/> <addaction name="actionShellExtension"/>
<addaction name="actionLineWrapping"/>
<addaction name="actionVerboseOutput"/> <addaction name="actionVerboseOutput"/>
</widget> </widget>
<addaction name="actionOpen"/> <addaction name="actionOpen"/>
@ -370,7 +371,15 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="text"> <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> </property>
</action> </action>
</widget> </widget>

View File

@ -21,7 +21,7 @@
//Version //Version
static unsigned int mixp_versionMajor = 2; static unsigned int mixp_versionMajor = 2;
static unsigned int mixp_versionMinor = 10; static unsigned int mixp_versionMinor = 11;
//MediaInfo Version //MediaInfo Version
static unsigned int mixp_miVersionMajor = 0; 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))); ui->actionLink_Discuss->setData(QVariant(QString::fromLatin1(LINK_DISCUSS)));
//Setup connections //Setup connections
connect(ui->analyzeButton, SIGNAL(clicked()), this, SLOT(analyzeButtonClicked())); connect(ui->analyzeButton, SIGNAL(clicked()), this, SLOT(analyzeButtonClicked()));
connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(analyzeButtonClicked())); connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(analyzeButtonClicked()));
connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(saveButtonClicked())); connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(saveButtonClicked()));
connect(ui->actionCopyToClipboard, SIGNAL(triggered()), this, SLOT(copyToClipboardButtonClicked())); connect(ui->actionCopyToClipboard, SIGNAL(triggered()), this, SLOT(copyToClipboardButtonClicked()));
connect(ui->actionClear, SIGNAL(triggered()), this, SLOT(clearButtonClicked())); connect(ui->actionClear, SIGNAL(triggered()), this, SLOT(clearButtonClicked()));
connect(ui->actionLink_MuldeR, SIGNAL(triggered()), this, SLOT(linkTriggered())); connect(ui->actionLink_MuldeR, SIGNAL(triggered()), this, SLOT(linkTriggered()));
connect(ui->actionLink_MediaInfo, 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->actionLink_Discuss, SIGNAL(triggered()), this, SLOT(linkTriggered()));
connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(showAboutScreen())); connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(showAboutScreen()));
connect(ui->actionShellExtension, SIGNAL(toggled(bool)), this, SLOT(updateShellExtension(bool))); connect(ui->actionShellExtension, SIGNAL(toggled(bool)), this, SLOT(updateShellExtension(bool)));
connect(m_ipc, SIGNAL(receivedStr(QString)), this, SLOT(fileReceived(QString))); connect(ui->actionLineWrapping, SIGNAL(toggled(bool)), this, SLOT(updateLineWrapping(bool)));
connect(m_ipc, SIGNAL(receivedStr(QString)), this, SLOT(fileReceived(QString)));
ui->versionLabel->installEventFilter(this); ui->versionLabel->installEventFilter(this);
//Context menu //Context menu
@ -563,7 +564,7 @@ void CMainWindow::processFinished(void)
htmlData.replaceInStrings(QRegExp("^([^:<>]+)$"), "<b><font color=\"darkred\">\\1</font></b>"); //Heading lines htmlData.replaceInStrings(QRegExp("^([^:<>]+)$"), "<b><font color=\"darkred\">\\1</font></b>"); //Heading lines
//Update document //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 //Enable actions
if(!m_outputLines.empty()) if(!m_outputLines.empty())
@ -600,6 +601,11 @@ void CMainWindow::updateShellExtension(bool checked)
ShellExtension::setEnabled(checked); ShellExtension::setEnabled(checked);
} }
void CMainWindow::updateLineWrapping(bool checked)
{
ui->textBrowser->setLineWrapMode(checked ? QTextEdit::WidgetWidth : QTextEdit::NoWrap);
}
void CMainWindow::linkTriggered(void) void CMainWindow::linkTriggered(void)
{ {
QObject *obj = QObject::sender(); QObject *obj = QObject::sender();

View File

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