Mess around with log UI. Herp Derp.

This commit is contained in:
Petr Mrázek 2014-07-13 01:49:46 +02:00
parent 4c0dc51110
commit 977cc1cfbb
3 changed files with 103 additions and 82 deletions

View File

@ -6,14 +6,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>831</width>
<height>596</height>
<width>825</width>
<height>782</height>
</rect>
</property>
<property name="windowTitle">
<string>Log</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
@ -26,7 +26,34 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Search:</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="pushButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Find next</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QPlainTextEdit" name="text">
<property name="undoRedoEnabled">
<bool>false</bool>
@ -45,25 +72,51 @@
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QPushButton" name="btnPaste">
<property name="toolTip">
<string>Upload the log to paste.ee - it will stay online for a month</string>
<widget class="QCheckBox" name="checkBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Upload Log</string>
<string>Keep updating</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnCopy">
<property name="toolTip">
<string>Copy the whole log into the clipboard</string>
</property>
<property name="text">
<string>&amp;Copy Log</string>
<string>&amp;Copy</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnPaste">
<property name="toolTip">
<string>Upload the log to paste.ee - it will stay online for a month</string>
</property>
<property name="text">
<string>Upload</string>
</property>
</widget>
</item>
@ -77,19 +130,6 @@
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>

View File

@ -29,7 +29,7 @@ OtherLogsPage::OtherLogsPage(BaseInstance *instance, QWidget *parent)
{
ui->setupUi(this);
m_watcher->setFileExpression(".*\\.log$");
m_watcher->setFileExpression("(.*\\.log(\\.[0-9]*)?$)|(crash-.*\\.txt)");
m_watcher->setRootDir(QDir::current().absoluteFilePath(m_instance->minecraftRoot()));
connect(m_watcher, &RecursiveFileSystemWatcher::filesChanged, this,
@ -55,7 +55,6 @@ void OtherLogsPage::populateSelectLogBox()
{
ui->selectLogBox->clear();
ui->selectLogBox->addItems(m_watcher->files());
ui->selectLogBox->addItem(tr("Other"), true);
if (m_currentFile.isNull())
{
ui->selectLogBox->setCurrentIndex(-1);
@ -63,6 +62,7 @@ void OtherLogsPage::populateSelectLogBox()
else
{
const int index = ui->selectLogBox->findText(m_currentFile);
if(index != -1)
ui->selectLogBox->setCurrentIndex(index);
}
}
@ -71,17 +71,9 @@ void OtherLogsPage::on_selectLogBox_currentIndexChanged(const int index)
{
QString file;
if (index != -1)
{
if (ui->selectLogBox->itemData(index).isValid())
{
file = QFileDialog::getOpenFileName(
this, tr("Open log file"), m_instance->minecraftRoot(), tr("*.log;;*.txt;;*"));
}
else
{
file = ui->selectLogBox->itemText(index);
}
}
if (file.isEmpty() || !QFile::exists(m_instance->minecraftRoot() + "/" + file))
{

View File

@ -6,14 +6,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>640</width>
<height>480</height>
<width>657</width>
<height>538</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>0</number>
</property>
@ -27,24 +27,14 @@
<number>0</number>
</property>
<item>
<widget class="QPlainTextEdit" name="text">
<property name="enabled">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QComboBox" name="selectLogBox">
<property name="maximumSize">
<size>
<width>96</width>
<height>16777215</height>
</size>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
@ -56,9 +46,12 @@
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<widget class="QPushButton" name="btnCopy">
<property name="toolTip">
<string>Copy the whole log into the clipboard</string>
</property>
<property name="text">
<string>&amp;Copy</string>
</property>
</widget>
</item>
@ -68,17 +61,7 @@
<string>Upload the log to paste.ee - it will stay online for a month</string>
</property>
<property name="text">
<string>Upload Log</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnCopy">
<property name="toolTip">
<string>Copy the whole log into the clipboard</string>
</property>
<property name="text">
<string>&amp;Copy Log</string>
<string>Upload</string>
</property>
</widget>
</item>
@ -92,23 +75,29 @@
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QPlainTextEdit" name="text">
<property name="enabled">
<bool>false</bool>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>text</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>