Merge branch 'master' of github.com:/pokerth/pokerth
@@ -29,8 +29,7 @@ using namespace std;
|
||||
ChatTools::ChatTools(QLineEdit* l, ConfigFile *c, ChatType ct, QTextBrowser *b, QStandardItemModel *m, gameLobbyDialogImpl *lo) : nickAutoCompletitionCounter(0), myLineEdit(l), myNickListModel(m), myNickStringList(NULL), myTextBrowser(b), myChatType(ct), myConfig(c), myNick(""), myLobby(lo)
|
||||
{
|
||||
myNick = QString::fromUtf8(myConfig->readConfigString("MyName").c_str());
|
||||
ignoreList = myConfig->readConfigStringList("PlayerIgnoreList");
|
||||
|
||||
ignoreList = myConfig->readConfigStringList("PlayerIgnoreList");
|
||||
}
|
||||
|
||||
ChatTools::~ChatTools()
|
||||
@@ -154,12 +153,14 @@ void ChatTools::receiveMessage(QString playerName, QString message, bool pm)
|
||||
|
||||
if(!nickFoundOnIgnoreList) {
|
||||
|
||||
tempMsg = checkForEmotes(tempMsg);
|
||||
|
||||
if(message.indexOf(QString("/me "))==0) {
|
||||
myTextBrowser->append(tempMsg.replace("/me ","<i>*"+playerName+" ")+"</i>");
|
||||
} else if(pm == true) {
|
||||
myTextBrowser->append("<i>"+playerName+"(pm): " + tempMsg+"</i>");
|
||||
} else {
|
||||
myTextBrowser->append(playerName + ": " + tempMsg);
|
||||
myTextBrowser->append(playerName + ": " + tempMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -313,3 +314,39 @@ unsigned ChatTools::parsePrivateMessageTarget(QString &chatText)
|
||||
return playerId;
|
||||
}
|
||||
|
||||
QString ChatTools::checkForEmotes(QString msg) {
|
||||
|
||||
msg.replace("0:-)", "<img src=\":emotes/emotes/face-angel.png\" />");
|
||||
msg.replace("X-(", "<img src=\":emotes/emotes/face-angry.png\" />");
|
||||
msg.replace("B-)", "<img src=\":emotes/emotes/face-cool.png\" />");
|
||||
msg.replace("8-)", "<img src=\":emotes/emotes/face-cool.png\" />");
|
||||
msg.replace(":'(", "<img src=\":emotes/emotes/face-crying.png\" />");
|
||||
msg.replace(">:-)", "<img src=\":emotes/emotes/face-devilish.png\" />");
|
||||
msg.replace(":-[", "<img src=\":emotes/emotes/face-embarrassed.png\" />");
|
||||
msg.replace(":-*", "<img src=\":emotes/emotes/face-kiss.png\" />");
|
||||
msg.replace(":-))", "<img src=\":emotes/emotes/face-laugh.png\" />");
|
||||
msg.replace(":))", "<img src=\":emotes/emotes/face-laugh.png\" />");
|
||||
msg.replace(":-|", "<img src=\":emotes/emotes/face-plain.png\" />");
|
||||
msg.replace(":-P", "<img src=\":emotes/emotes/face-raspberry.png\" />");
|
||||
msg.replace(":-p", "<img src=\":emotes/emotes/face-raspberry.png\" />");
|
||||
msg.replace(":-(", "<img src=\":emotes/emotes/face-sad.png\" />");
|
||||
msg.replace(":(", "<img src=\":emotes/emotes/face-sad.png\" />");
|
||||
msg.replace(":-&", "<img src=\":emotes/emotes/face-sick.png\" />");
|
||||
msg.replace(":-D", "<img src=\":emotes/emotes/face-smile-big.png\" />");
|
||||
msg.replace(":D", "<img src=\":emotes/emotes/face-smile-big.png\" />");
|
||||
msg.replace(":-!", "<img src=\":emotes/emotes/face-smirk.png\" />");
|
||||
msg.replace(":-0", "<img src=\":emotes/emotes/face-surprise.png\" />");
|
||||
msg.replace(":-O", "<img src=\":emotes/emotes/face-surprise.png\" />");
|
||||
msg.replace(":-o", "<img src=\":emotes/emotes/face-surprise.png\" />");
|
||||
msg.replace(":-/", "<img src=\":emotes/emotes/face-uncertain.png\" />");
|
||||
msg.replace(":/", "<img src=\":emotes/emotes/face-uncertain.png\" />");
|
||||
msg.replace(";-)", "<img src=\":emotes/emotes/face-wink.png\" />");
|
||||
msg.replace(";)", "<img src=\":emotes/emotes/face-wink.png\" />");
|
||||
msg.replace(":-S", "<img src=\":emotes/emotes/face-worried.png\" />");
|
||||
msg.replace(":-s", "<img src=\":emotes/emotes/face-worried.png\" />");
|
||||
msg.replace(":-)", "<img src=\":emotes/emotes/face-smile.png\" />");
|
||||
msg.replace(":)", "<img src=\":emotes/emotes/face-smile.png\" />");
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
@@ -74,6 +74,7 @@ public slots:
|
||||
myStyle = theValue;
|
||||
}
|
||||
void refreshIgnoreList();
|
||||
QString checkForEmotes(QString);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -0,0 +1,220 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>LogFileDialog</class>
|
||||
<widget class="QDialog" name="LogFileDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>618</width>
|
||||
<height>392</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_exportLogHtml">
|
||||
<property name="text">
|
||||
<string>Export as HTML</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resources/pokerth.qrc">
|
||||
<normaloff>:/gfx/text-html.png</normaloff>:/gfx/text-html.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_exportLogTxt">
|
||||
<property name="text">
|
||||
<string>Export as txt</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resources/pokerth.qrc">
|
||||
<normaloff>:/gfx/text-plain.png</normaloff>:/gfx/text-plain.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_saveLogAs">
|
||||
<property name="text">
|
||||
<string>Save as ...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resources/pokerth.qrc">
|
||||
<normaloff>:/gfx/filesave.png</normaloff>:/gfx/filesave.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_deleteLog">
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resources/pokerth.qrc">
|
||||
<normaloff>:/gfx/editdelete.png</normaloff>:/gfx/editdelete.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<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>
|
||||
<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>
|
||||
<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 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>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="resources/pokerth.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>LogFileDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>LogFileDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
@@ -14,6 +14,85 @@
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_exportLogHtml">
|
||||
<property name="text">
|
||||
<string>Export as HTML</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resources/pokerth.qrc">
|
||||
<normaloff>:/gfx/text-html.png</normaloff>:/gfx/text-html.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_exportLogTxt">
|
||||
<property name="text">
|
||||
<string>Export as txt</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resources/pokerth.qrc">
|
||||
<normaloff>:/gfx/text-plain.png</normaloff>:/gfx/text-plain.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_saveLogAs">
|
||||
<property name="text">
|
||||
<string>Save as ...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resources/pokerth.qrc">
|
||||
<normaloff>:/gfx/filesave.png</normaloff>:/gfx/filesave.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_deleteLog">
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resources/pokerth.qrc">
|
||||
<normaloff>:/gfx/editdelete.png</normaloff>:/gfx/editdelete.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<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>
|
||||
<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>
|
||||
@@ -81,89 +160,21 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<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>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_exportLogHtml">
|
||||
<property name="text">
|
||||
<string>Export as HTML</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resources/pokerth.qrc">
|
||||
<normaloff>:/gfx/text-html.png</normaloff>:/gfx/text-html.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_exportLogTxt">
|
||||
<property name="text">
|
||||
<string>Export as txt</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resources/pokerth.qrc">
|
||||
<normaloff>:/gfx/text-plain.png</normaloff>:/gfx/text-plain.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_saveLogAs">
|
||||
<property name="text">
|
||||
<string>Save as ...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resources/pokerth.qrc">
|
||||
<normaloff>:/gfx/filesave.png</normaloff>:/gfx/filesave.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_deleteLog">
|
||||
<property name="text">
|
||||
<string>Delete</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resources/pokerth.qrc">
|
||||
<normaloff>:/gfx/editdelete.png</normaloff>:/gfx/editdelete.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="pushButton_analyseLogfile">
|
||||
<property name="text">
|
||||
<string>Analyse Logfile ...</string>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
<property name="icon">
|
||||
<iconset resource="resources/pokerth.qrc">
|
||||
<normaloff>:/gfx/view-statistics.png</normaloff>:/gfx/view-statistics.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
#include "callback.h"
|
||||
|
||||
Callback::Callback()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
size_t
|
||||
Callback::writeCallback(char* buf, size_t size, size_t nmemb, void* up)
|
||||
{
|
||||
data = "";
|
||||
|
||||
for (int c = 0; c<size*nmemb; c++)
|
||||
{
|
||||
data.push_back(buf[c]);
|
||||
}
|
||||
return size*nmemb;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#ifndef CALLBACK_H
|
||||
#define CALLBACK_H
|
||||
|
||||
#include <iostream>
|
||||
|
||||
class Callback
|
||||
{
|
||||
public:
|
||||
Callback();
|
||||
|
||||
size_t writeCallback(char* buf, size_t size, size_t nmemb, void* up);
|
||||
|
||||
std::string getData() { return data; }
|
||||
|
||||
private:
|
||||
|
||||
std::string data;
|
||||
|
||||
};
|
||||
|
||||
#endif // CALLBACK_H
|
||||
@@ -17,23 +17,31 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#include "logfiledialog.h"
|
||||
#ifdef GUI_800x480
|
||||
#include "ui_logfiledialog_800x480.h"
|
||||
#else
|
||||
#include "ui_logfiledialog.h"
|
||||
#endif
|
||||
|
||||
#include <QtCore>
|
||||
#include "guilog.h"
|
||||
#include "configfile.h"
|
||||
#include "mymessagebox.h"
|
||||
#include "callback.h"
|
||||
#include "curl/curl.h"
|
||||
|
||||
LogFileDialog::LogFileDialog(QWidget *parent, ConfigFile *c) :
|
||||
QDialog(parent), myConfig(c),
|
||||
ui(new Ui::LogFileDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
|
||||
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()));
|
||||
connect( ui->pushButton_saveLogAs, SIGNAL(clicked()), this, SLOT (saveLogFileAs()));
|
||||
connect( ui->treeWidget_logFiles, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(showLogFilePreview()));
|
||||
connect( ui->pushButton_analyseLogfile, SIGNAL(clicked()), this, SLOT (uploadFile()));
|
||||
}
|
||||
|
||||
LogFileDialog::~LogFileDialog()
|
||||
@@ -167,3 +175,61 @@ void LogFileDialog::keyPressEvent ( QKeyEvent * event )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Callback* curl_writedata = new Callback();
|
||||
void writeCallback(char* buf, size_t size, size_t nmemb, void* up)
|
||||
{
|
||||
curl_writedata->writeCallback(buf, size, nmemb, up);
|
||||
}
|
||||
|
||||
void LogFileDialog::uploadFile()
|
||||
{
|
||||
QTreeWidgetItem* selectedItem = ui->treeWidget_logFiles->currentItem();
|
||||
|
||||
if(selectedItem) {
|
||||
file.setFileName(selectedItem->data(0, Qt::UserRole).toString());
|
||||
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
|
||||
struct curl_httppost* post = NULL;
|
||||
struct curl_httppost* last = NULL;
|
||||
|
||||
curl = curl_easy_init();
|
||||
|
||||
if(curl) {
|
||||
|
||||
curl_formadd(&post, &last,
|
||||
CURLFORM_COPYNAME, "pdb_file",
|
||||
CURLFORM_FILE, file.fileName().toStdString().c_str(),
|
||||
CURLFORM_END);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://pokerth.net/floty_upload/upload.php");
|
||||
curl_easy_setopt(curl, CURLOPT_HTTPPOST, post);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writeCallback);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(res) {
|
||||
qDebug() << "curl_easy_perform failed: " << res << endl;
|
||||
}
|
||||
|
||||
id = QString(curl_writedata->getData().data()).trimmed();
|
||||
|
||||
curl_formfree(post);
|
||||
|
||||
if(id.length() == 40 && !id.contains("ERROR")) {
|
||||
|
||||
qDebug() << id << endl;
|
||||
QDesktopServices::openUrl(QUrl("http://logfile-analysis.pokerth.net/?ID="+id));
|
||||
|
||||
} else {
|
||||
qDebug() << QString::fromStdString(curl_writedata->getData()) << endl;
|
||||
}
|
||||
} else {
|
||||
qDebug() << "curl_easy_init failed\n" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#define LOGFILEDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#include <QFile>
|
||||
|
||||
namespace Ui {
|
||||
class LogFileDialog;
|
||||
@@ -29,6 +29,7 @@ namespace Ui {
|
||||
|
||||
class guiLog;
|
||||
class ConfigFile;
|
||||
class Callback;
|
||||
|
||||
class LogFileDialog : public QDialog
|
||||
{
|
||||
@@ -48,12 +49,17 @@ public slots:
|
||||
void exportLogToTxt();
|
||||
void saveLogFileAs();
|
||||
void showLogFilePreview();
|
||||
void keyPressEvent ( QKeyEvent * event );
|
||||
void keyPressEvent ( QKeyEvent * event );
|
||||
void uploadFile();
|
||||
|
||||
private:
|
||||
private:
|
||||
ConfigFile *myConfig;
|
||||
guiLog *myGuiLog;
|
||||
Ui::LogFileDialog *ui;
|
||||
Ui::LogFileDialog *ui;
|
||||
int writer(char *data, size_t size, size_t nmemb,std::string *buffer);
|
||||
QFile file;
|
||||
QString id;
|
||||
|
||||
};
|
||||
|
||||
#endif // LOGFILEDIALOG_H
|
||||
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
@@ -1,4 +1,4 @@
|
||||
<RCC>
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource prefix="/gfx">
|
||||
<file>view-fullscreen.png</file>
|
||||
<file>swbuttoninternetgame.png</file>
|
||||
@@ -309,4 +309,31 @@
|
||||
<file>cflags/np.png</file>
|
||||
<file>cflags/undefined.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/emotes">
|
||||
<file>emotes/face-angel.png</file>
|
||||
<file>emotes/face-angry.png</file>
|
||||
<file>emotes/face-confused.png</file>
|
||||
<file>emotes/face-cool.png</file>
|
||||
<file>emotes/face-crying.png</file>
|
||||
<file>emotes/face-devilish.png</file>
|
||||
<file>emotes/face-embarrassed.png</file>
|
||||
<file>emotes/face-in-love.png</file>
|
||||
<file>emotes/face-kiss.png</file>
|
||||
<file>emotes/face-laugh.png</file>
|
||||
<file>emotes/face-plain.png</file>
|
||||
<file>emotes/face-quiet.png</file>
|
||||
<file>emotes/face-raspberry.png</file>
|
||||
<file>emotes/face-sad.png</file>
|
||||
<file>emotes/face-sick.png</file>
|
||||
<file>emotes/face-sleep.png</file>
|
||||
<file>emotes/face-smile-big.png</file>
|
||||
<file>emotes/face-smile-grin.png</file>
|
||||
<file>emotes/face-smile.png</file>
|
||||
<file>emotes/face-smirk.png</file>
|
||||
<file>emotes/face-surprise.png</file>
|
||||
<file>emotes/face-uncertain.png</file>
|
||||
<file>emotes/face-wink.png</file>
|
||||
<file>emotes/face-worried.png</file>
|
||||
<file>emotes/face-yawn.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*****************************************************************************
|
||||
* PokerTH - The open source texas holdem engine *
|
||||
* Copyright (C) 2006-2011 Felix Hammer, Florian Thauer, Lothar May *
|
||||
* Copyright (C) 2006-2012 Felix Hammer, Florian Thauer, Lothar May *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Affero General Public License as *
|
||||
|
||||
@@ -73,7 +73,7 @@ int main( int argc, char **argv )
|
||||
/////// can be removed for non-qt-guis ////////////
|
||||
QtSingleApplication a( argc, argv );
|
||||
|
||||
if (a.sendMessage("Wake up!")) {
|
||||
if (a.sendMessage("Wake up!")) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -138,8 +138,8 @@ int main( int argc, char **argv )
|
||||
qRegisterMetaType<DenyGameInvitationReason>("DenyGameInvitationReason");
|
||||
///////////////////////////////////////////////////
|
||||
|
||||
startWindowImpl mainWin(myConfig,myLog);
|
||||
a.setActivationWindow(&mainWin, true);
|
||||
startWindowImpl mainWin(myConfig,myLog);
|
||||
a.setActivationWindow(&mainWin, true);
|
||||
|
||||
int retVal = a.exec();
|
||||
|
||||
|
||||