add uploadanimation for logfiledialog (#146)

This commit is contained in:
doitux
2012-12-19 11:21:24 +01:00
parent 0e052b0efe
commit efd4b1603c
6 changed files with 264 additions and 190 deletions
+120 -99
View File
@@ -20,7 +20,99 @@
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0" colspan="2">
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Game:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTreeWidget" name="treeWidget_logFiles">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>250</width>
<height>16777215</height>
</size>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="indentation">
<number>5</number>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>Log File</string>
</property>
</column>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QLabel" name="label_37">
<property name="text">
<string>Preview:</string>
</property>
</widget>
</item>
<item>
<widget class="QTextBrowser" name="textBrowser_logPreview">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QPushButton" name="pushButton_exportLogHtml">
@@ -92,28 +184,48 @@
</item>
</layout>
</item>
<item row="0" column="1">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item row="2" column="0" rowspan="2" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_37">
<widget class="QLabel" name="label_animation">
<property name="text">
<string>Preview:</string>
<string/>
</property>
</widget>
</item>
<item>
<widget class="QTextBrowser" name="textBrowser_logPreview">
<widget class="QPushButton" name="pushButton_analyseLogfile">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Analyse Logfile ...</string>
</property>
<property name="icon">
<iconset resource="../resources/pokerth.qrc">
<normaloff>:/gfx/view-statistics.png</normaloff>:/gfx/view-statistics.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="0" colspan="2">
<item row="3" column="1">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="minimumSize">
<size>
@@ -129,97 +241,6 @@
</property>
</widget>
</item>
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Game:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTreeWidget" name="treeWidget_logFiles">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>250</width>
<height>16777215</height>
</size>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="indentation">
<number>5</number>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>Log File</string>
</property>
</column>
</widget>
</item>
</layout>
</item>
<item row="3" column="0" colspan="2">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QPushButton" name="pushButton_analyseLogfile">
<property name="text">
<string>Analyse Logfile ...</string>
</property>
<property name="icon">
<iconset resource="../resources/pokerth.qrc">
<normaloff>:/gfx/view-statistics.png</normaloff>:/gfx/view-statistics.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
+108 -88
View File
@@ -14,7 +14,92 @@
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0" colspan="2">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Game:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox"/>
</item>
</layout>
</item>
<item>
<widget class="QTreeWidget" name="treeWidget_logFiles">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>16777215</height>
</size>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="indentation">
<number>5</number>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>Log File</string>
</property>
</column>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QLabel" name="label_37">
<property name="text">
<string>Preview:</string>
</property>
</widget>
</item>
<item>
<widget class="QTextBrowser" name="textBrowser_logPreview">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QPushButton" name="pushButton_exportLogHtml">
@@ -62,119 +147,54 @@
</item>
</layout>
</item>
<item row="0" column="1">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_animation">
<item>
<widget class="QLabel" name="label_37">
<widget class="QLabel" name="label_animation">
<property name="text">
<string>Preview:</string>
<string/>
</property>
</widget>
</item>
<item>
<widget class="QTextBrowser" name="textBrowser_logPreview">
<widget class="QPushButton" name="pushButton_analyseLogfile">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="0" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Game:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTreeWidget" name="treeWidget_logFiles">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="text">
<string>Analyse Logfile ...</string>
</property>
<property name="maximumSize">
<property name="icon">
<iconset resource="resources/pokerth.qrc">
<normaloff>:/gfx/view-statistics.png</normaloff>:/gfx/view-statistics.png</iconset>
</property>
<property name="iconSize">
<size>
<width>200</width>
<height>16777215</height>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="indentation">
<number>5</number>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>Log File</string>
</property>
</column>
</widget>
</item>
</layout>
</item>
<item row="3" column="0" colspan="2">
<item row="3" column="0">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QPushButton" name="pushButton_analyseLogfile">
<property name="text">
<string>Analyse Logfile ...</string>
<item row="4" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="icon">
<iconset resource="resources/pokerth.qrc">
<normaloff>:/gfx/view-statistics.png</normaloff>:/gfx/view-statistics.png</iconset>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
+31 -1
View File
@@ -36,6 +36,9 @@ ui(new Ui::LogFileDialog)
{
ui->setupUi(this);
ui->label_animation->setMaximumWidth(0);
ui->horizontalLayout_animation->setSpacing(0);
connect( ui->pushButton_deleteLog, SIGNAL(clicked()), this, SLOT (deleteLogFile()));
connect( ui->pushButton_exportLogHtml, SIGNAL(clicked()), this, SLOT (exportLogToHtml()));
connect( ui->pushButton_exportLogTxt, SIGNAL(clicked()), this, SLOT (exportLogToTxt()));
@@ -191,9 +194,15 @@ void LogFileDialog::keyPressEvent ( QKeyEvent * event )
{
if (event->key() == Qt::Key_Delete ) { /*Delete*/
if(ui->treeWidget_logFiles->hasFocus()) {
ui->pushButton_deleteLog->click();
ui->pushButton_deleteLog->click();
}
}
else if (event->key() == Qt::Key_N ){
uploadInProgressAnimationStart();
}
else if (event->key() == Qt::Key_M ){
uploadInProgressAnimationStop();
}
}
@@ -257,3 +266,24 @@ void LogFileDialog::uploadFile()
}
}
void LogFileDialog::uploadInProgressAnimationStart()
{
ui->pushButton_analyseLogfile->setDisabled(TRUE);
QMovie *movie = new QMovie(":/gfx/loader.gif");
ui->label_animation->setMovie(movie);
ui->label_animation->setMaximumWidth(32);
ui->horizontalLayout_animation->setSpacing(-1);
ui->label_animation->setGeometry(0,0,32,32);
movie->start();
}
void LogFileDialog::uploadInProgressAnimationStop()
{
ui->pushButton_analyseLogfile->setDisabled(FALSE);
ui->label_animation->setMaximumWidth(0);
ui->horizontalLayout_animation->setSpacing(0);
ui->label_animation->setGeometry(0,0,0,0);
}
+3 -1
View File
@@ -54,7 +54,9 @@ public slots:
void showLogFilePreview(ShowLogMode);
void keyPressEvent ( QKeyEvent * event );
void uploadFile();
void uploadInProgressAnimationStart();
void uploadInProgressAnimationStop();
private:
ConfigFile *myConfig;
guiLog *myGuiLog;
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

+2 -1
View File
@@ -1,4 +1,4 @@
<!DOCTYPE RCC><RCC version="1.0">
<RCC>
<qresource prefix="/gfx">
<file>view-fullscreen.png</file>
<file>swbuttoninternetgame.png</file>
@@ -58,6 +58,7 @@
<file>preferences-desktop_50x50.png</file>
<file>tab-close.png</file>
<file>tab-new-background.png</file>
<file>loader.gif</file>
</qresource>
<qresource prefix="/cflags">
<file>cflags/ad.png</file>