mirror of
https://github.com/arcan1s/reportabug.git
synced 2025-04-28 09:17:18 +00:00
Compare commits
No commits in common. "master" and "V.1.0.0" have entirely different histories.
1
.gitignore
vendored
1
.gitignore
vendored
@ -22,7 +22,6 @@ qrc_*.cpp
|
|||||||
ui_*.h
|
ui_*.h
|
||||||
Makefile*
|
Makefile*
|
||||||
*-build-*
|
*-build-*
|
||||||
*.qm
|
|
||||||
|
|
||||||
# QtCreator
|
# QtCreator
|
||||||
|
|
||||||
|
10
CHANGELOG
10
CHANGELOG
@ -1,12 +1,2 @@
|
|||||||
Ver.1.1.0:
|
|
||||||
+ add abillity to load parametrs dynamically
|
|
||||||
* some fixes
|
|
||||||
|
|
||||||
Ver.1.0.2:
|
|
||||||
* some fixes
|
|
||||||
|
|
||||||
Ver.1.0.1:
|
|
||||||
* fix captcha
|
|
||||||
|
|
||||||
Ver.1.0:
|
Ver.1.0:
|
||||||
First release
|
First release
|
||||||
|
21
README.md
21
README.md
@ -4,12 +4,12 @@ reportabug
|
|||||||
Information
|
Information
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
Qt application/library which allows users to create an issue for GitHub projects. It may work over [GitHub](https://github.com) or [GitReport](https://gitreports.com/). For the developer configuration please use `config.h` header.
|
Qt application/library which allows users to create an issue for GitHub projects. It may work over [GitHub](https://github.com) or [GitReport](https://gitreports.com/). For the developer configuration please use `config.h.in` header.
|
||||||
|
|
||||||
Configuration
|
Configuration
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
Edit `src/config.h` header and set up needed variables or load parametrs dynamically using `params` array (**NOTE** please use the same keys as for `config.h`).
|
Edit `src/config.h.in` header and set up needed variables.
|
||||||
|
|
||||||
### Main configuration ###
|
### Main configuration ###
|
||||||
|
|
||||||
@ -50,11 +50,13 @@ This module requires `QtNetwork` module. To enable this module set up your token
|
|||||||
|
|
||||||
Available variables:
|
Available variables:
|
||||||
|
|
||||||
* `CAPTCHA_URL` - captcha url, in the most cases do not touch it. Default is `https://gitreports.com/simple_captcha?code=`.
|
* `CAPTCHA_KEY` - captcha key. It may be found in the source of the `PUBLIC_URL` page. Default is `7f6ef90bce7389088a52c5c9101aad206b21b56d`.
|
||||||
|
* `CAPTCHA_TEXT` - captcha text. It may be found in the source of the `PUBLIC_URL` page. Default is `QJNZXY`.
|
||||||
|
* `CAPTCHA_TIME` - captcha time. It may be found in the source of the `PUBLIC_URL` page. Default is `1406531273`.
|
||||||
* `GITREPORT_COMBOBOX` - text of this module into comboBox.
|
* `GITREPORT_COMBOBOX` - text of this module into comboBox.
|
||||||
* `PUBLIC_URL` - issues url, in the most cases do not touch it. Default is `https://gitreports.com/issue/$OWNER/$PROJECT`. Available tags here are `$PROJECT`, `$OWNER`.
|
* `PUBLIC_URL` - issues url, in the most cases do not touch it. Default is `https://gitreports.com/issue/$OWNER/$PROJECT`. Available tags here are `$PROJECT`, `$OWNER`.
|
||||||
|
|
||||||
This module requires `QtWebKit` and `QtNetwork` modules. To disable this module use `-DENABLE_GITREPORT=0` cmake flag.
|
This module requires `QtWebKit` module. To disable this module use `-DENABLE_GITREPORT=0` cmake flag.
|
||||||
|
|
||||||
Instruction
|
Instruction
|
||||||
===========
|
===========
|
||||||
@ -63,17 +65,17 @@ Dependencies
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
* qt5-base (if Qt5 is used) or qt4 (if Qt4 is used)
|
* qt5-base (if Qt5 is used) or qt4 (if Qt4 is used)
|
||||||
* qt5-network (if Qt5 is used)
|
|
||||||
|
|
||||||
### Optional dependencies ###
|
### Optional dependencies ###
|
||||||
|
|
||||||
|
* qt5-network (if Qt5 is used) *(requires for GitHub module)*
|
||||||
* qt5-webkit (if Qt5 is used) or qtwebkit (if Qt4 is used) *(requires for GitReport module)*
|
* qt5-webkit (if Qt5 is used) or qtwebkit (if Qt4 is used) *(requires for GitReport module)*
|
||||||
|
* doxygen *(developers documentation)*
|
||||||
|
|
||||||
### Make dependencies ###
|
### Make dependencies ###
|
||||||
|
|
||||||
* automoc4
|
* automoc4
|
||||||
* cmake
|
* cmake
|
||||||
* doxygen *(optional, developers documentation)*
|
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
@ -100,18 +102,15 @@ Installation
|
|||||||
|
|
||||||
* declare class in you sources. For example:
|
* declare class in you sources. For example:
|
||||||
|
|
||||||
Reportabug *reportWindow = new Reportabug(parent=this,
|
Reportabug *reportWindow = new Reportabug(this, false);
|
||||||
debugCmd=false,
|
|
||||||
params=0);
|
|
||||||
reportWindow->showWindow();
|
reportWindow->showWindow();
|
||||||
|
|
||||||
* link your application with this library
|
* link your application with this library
|
||||||
|
|
||||||
### Available cmake flags ###
|
### Available cmake flags ###
|
||||||
|
|
||||||
* `-DBUILD_AS_LIBRARY:BOOL=0` - build the application but not a library
|
* `-DBUILD_AS_LIBRARY:BOOL=0` - build the application but not a shared library
|
||||||
* `-DBUILD_DOCS:BOOL=1` - build developer documentation
|
* `-DBUILD_DOCS:BOOL=1` - build developer documentation
|
||||||
* `-DBUILD_SHARED_LIBRARY=1` - build a shared library instead of static one
|
|
||||||
* `-DENABLE_GITHUB=0` - disable GitHub module
|
* `-DENABLE_GITHUB=0` - disable GitHub module
|
||||||
* `-DENABLE_GITREPORT=0` - disable GitReport module
|
* `-DENABLE_GITREPORT=0` - disable GitReport module
|
||||||
* `-DOWN_GITHUB_TOKEN=STRING` - use STRING as own GitHub token
|
* `-DOWN_GITHUB_TOKEN=STRING` - use STRING as own GitHub token
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
ARCHIVE="reportabug"
|
ARCHIVE="reportabug"
|
||||||
SRCDIR="sources"
|
SRCDIR="sources"
|
||||||
FILES="AUTHORS CHANGELOG COPYING README.md"
|
FILES="AUTHORS CHANGELOG COPYING README.md"
|
||||||
IGNORELIST="build *.cppcheck *.qm"
|
IGNORELIST="build *.cppcheck"
|
||||||
VERSION=$(grep -m1 PROJECT_VERSION_MAJOR sources/CMakeLists.txt | awk '{print $3}' | cut -c 1).\
|
VERSION=$(grep -m1 PROJECT_VERSION_MAJOR sources/CMakeLists.txt | awk '{print $3}' | cut -c 1).\
|
||||||
$(grep -m1 PROJECT_VERSION_MINOR sources/CMakeLists.txt | awk '{print $3}' | cut -c 1).\
|
$(grep -m1 PROJECT_VERSION_MINOR sources/CMakeLists.txt | awk '{print $3}' | cut -c 1).\
|
||||||
$(grep -m1 PROJECT_VERSION_PATCH sources/CMakeLists.txt | awk '{print $3}' | cut -c 1)
|
$(grep -m1 PROJECT_VERSION_PATCH sources/CMakeLists.txt | awk '{print $3}' | cut -c 1)
|
||||||
|
@ -4,7 +4,6 @@ cmake_policy (SET CMP0003 OLD)
|
|||||||
cmake_policy (SET CMP0002 OLD)
|
cmake_policy (SET CMP0002 OLD)
|
||||||
cmake_policy (SET CMP0011 NEW)
|
cmake_policy (SET CMP0011 NEW)
|
||||||
cmake_policy (SET CMP0015 NEW)
|
cmake_policy (SET CMP0015 NEW)
|
||||||
cmake_policy (SET CMP0048 OLD)
|
|
||||||
|
|
||||||
project (reportabug)
|
project (reportabug)
|
||||||
|
|
||||||
@ -13,7 +12,7 @@ set (SUBPROJECT_AUTHOR "Evgeniy Alekseev")
|
|||||||
set (SUBPROJECT_CONTACT "esalexeev@gmail.com")
|
set (SUBPROJECT_CONTACT "esalexeev@gmail.com")
|
||||||
set (SUBPROJECT_LICENSE "LGPLv3")
|
set (SUBPROJECT_LICENSE "LGPLv3")
|
||||||
set (SUBPROJECT_VERSION_MAJOR 1)
|
set (SUBPROJECT_VERSION_MAJOR 1)
|
||||||
set (SUBPROJECT_VERSION_MINOR 1)
|
set (SUBPROJECT_VERSION_MINOR 0)
|
||||||
set (SUBPROJECT_VERSION_PATCH 0)
|
set (SUBPROJECT_VERSION_PATCH 0)
|
||||||
set (SUBPROJECT_VERSION ${SUBPROJECT_VERSION_MAJOR}.${SUBPROJECT_VERSION_MINOR}.${SUBPROJECT_VERSION_PATCH})
|
set (SUBPROJECT_VERSION ${SUBPROJECT_VERSION_MAJOR}.${SUBPROJECT_VERSION_MINOR}.${SUBPROJECT_VERSION_PATCH})
|
||||||
string (TIMESTAMP CURRENT_DATE "%Y-%m-%d %H:%M" UTC)
|
string (TIMESTAMP CURRENT_DATE "%Y-%m-%d %H:%M" UTC)
|
||||||
@ -24,12 +23,11 @@ message (STATUS "Version: ${SUBPROJECT_VERSION}")
|
|||||||
message (STATUS "Build date: ${CURRENT_DATE}")
|
message (STATUS "Build date: ${CURRENT_DATE}")
|
||||||
|
|
||||||
# install options
|
# install options
|
||||||
set (BUILD_AS_LIBRARY ON CACHE BOOL "Build the application as a library")
|
option (BUILD_AS_LIBRARY "Build the application as a shared library" ON)
|
||||||
set (BUILD_DOCS OFF CACHE BOOL "Build developers documentation")
|
option (BUILD_DOCS "Build developers documentation" OFF)
|
||||||
set (BUILD_SHARED_LIBRARY OFF CACHE BOOL "Build the shared library")
|
option (ENABLE_GITHUB "Enable GitHub module" ON)
|
||||||
set (ENABLE_GITHUB ON CACHE BOOL "Enable GitHub module")
|
option (ENABLE_GITREPORT "Enable GitReport module" ON)
|
||||||
set (ENABLE_GITREPORT ON CACHE BOOL "Enable GitReport module")
|
option (USE_QT5 "Use Qt5 instead of Qt4" ON)
|
||||||
set (USE_QT5 ON CACHE BOOL "Use Qt5 instead of Qt4")
|
|
||||||
set (OWN_GITHUB_TOKEN "" CACHE STRING "Use own GitHub token instead of GitReport")
|
set (OWN_GITHUB_TOKEN "" CACHE STRING "Use own GitHub token instead of GitReport")
|
||||||
# set flags
|
# set flags
|
||||||
if (OWN_GITHUB_TOKEN STREQUAL "")
|
if (OWN_GITHUB_TOKEN STREQUAL "")
|
||||||
@ -40,11 +38,6 @@ endif ()
|
|||||||
if (USE_OWN_TOKEN)
|
if (USE_OWN_TOKEN)
|
||||||
set (ENABLE_GITREPORT OFF)
|
set (ENABLE_GITREPORT OFF)
|
||||||
endif ()
|
endif ()
|
||||||
if (BUILD_SHARED_LIBRARY)
|
|
||||||
set (LIBPROP SHARED)
|
|
||||||
else ()
|
|
||||||
set (LIBPROP STATIC)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
# flags
|
# flags
|
||||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
@ -1 +0,0 @@
|
|||||||
src/reportabug.h
|
|
@ -1,16 +1,17 @@
|
|||||||
# set files
|
# set files
|
||||||
set (SOURCES ${SUBPROJECT_SOURCE_DIR}/main.cpp ${SUBPROJECT_SOURCE_DIR}/reportabug.cpp)
|
set (SOURCES main.cpp reportabug.cpp)
|
||||||
set (HEADERS ${SUBPROJECT_SOURCE_DIR}/reportabug.h ${SUBPROJECT_SOURCE_DIR}/config.h)
|
set (HEADERS reportabug.h)
|
||||||
set (FORMS ${SUBPROJECT_SOURCE_DIR}/reportabug.ui)
|
set (FORMS reportabug.ui)
|
||||||
if (ENABLE_GITHUB OR USE_OWN_TOKEN)
|
if (ENABLE_GITHUB OR USE_OWN_TOKEN)
|
||||||
set (SOURCES ${SOURCES} ${SUBPROJECT_SOURCE_DIR}/githubmodule.cpp)
|
set (SOURCES ${SOURCES} githubmodule.cpp)
|
||||||
set (HEADERS ${HEADERS} ${SUBPROJECT_SOURCE_DIR}/githubmodule.h)
|
set (HEADERS ${HEADERS} githubmodule.h)
|
||||||
endif ()
|
endif ()
|
||||||
if (ENABLE_GITREPORT)
|
if (ENABLE_GITREPORT)
|
||||||
set (SOURCES ${SOURCES} ${SUBPROJECT_SOURCE_DIR}/gitreportmodule.cpp)
|
set (SOURCES ${SOURCES} gitreportmodule.cpp)
|
||||||
set (HEADERS ${HEADERS} ${SUBPROJECT_SOURCE_DIR}/gitreportmodule.h)
|
set (HEADERS ${HEADERS} gitreportmodule.h)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||||
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/inconfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/inconfig.h)
|
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/inconfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/inconfig.h)
|
||||||
|
|
||||||
# include_path
|
# include_path
|
||||||
@ -21,12 +22,16 @@ include_directories (${CMAKE_CURRENT_BINARY_DIR}/../
|
|||||||
if (USE_QT5)
|
if (USE_QT5)
|
||||||
find_package (Qt5Core REQUIRED)
|
find_package (Qt5Core REQUIRED)
|
||||||
find_package (Qt5Widgets REQUIRED)
|
find_package (Qt5Widgets REQUIRED)
|
||||||
find_package (Qt5Network REQUIRED)
|
|
||||||
add_definitions (${Qt5Core_DEFINITIONS})
|
add_definitions (${Qt5Core_DEFINITIONS})
|
||||||
add_definitions (${Qt5Widgets_DEFINITIONS})
|
add_definitions (${Qt5Widgets_DEFINITIONS})
|
||||||
add_definitions (${Qt5Network_DEFINITIONS})
|
include_directories (${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS})
|
||||||
include_directories (${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS})
|
set (QT_USED_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES})
|
||||||
set (QT_USED_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Network_LIBRARIES})
|
if (ENABLE_GITHUB OR USE_OWN_TOKEN)
|
||||||
|
find_package (Qt5Network REQUIRED)
|
||||||
|
add_definitions (${Qt5Network_DEFINITIONS})
|
||||||
|
include_directories (${Qt5Network_INCLUDE_DIRS})
|
||||||
|
set (QT_USED_LIBRARIES ${QT_USED_LIBRARIES} ${Qt5Network_LIBRARIES})
|
||||||
|
endif ()
|
||||||
if (ENABLE_GITREPORT)
|
if (ENABLE_GITREPORT)
|
||||||
find_package (Qt5WebKit REQUIRED)
|
find_package (Qt5WebKit REQUIRED)
|
||||||
find_package (Qt5WebKitWidgets REQUIRED)
|
find_package (Qt5WebKitWidgets REQUIRED)
|
||||||
@ -37,14 +42,25 @@ if (USE_QT5)
|
|||||||
endif ()
|
endif ()
|
||||||
qt5_wrap_cpp (MOC_SOURCES ${HEADERS})
|
qt5_wrap_cpp (MOC_SOURCES ${HEADERS})
|
||||||
qt5_wrap_ui (UI_HEADERS ${FORMS})
|
qt5_wrap_ui (UI_HEADERS ${FORMS})
|
||||||
|
|
||||||
|
source_group ("Header Files" FILES ${HEADERS})
|
||||||
|
source_group ("Source Files" FILES ${SOURCES})
|
||||||
|
source_group ("Generated Files" FILES ${MOC_SOURCES})
|
||||||
|
|
||||||
else ()
|
else ()
|
||||||
set (QT_USED_COMPONENTS QtCore QtGui QtNetwork)
|
set (QT_USED_COMPONENTS QtCore QtGui)
|
||||||
|
if (ENABLE_GITHUB OR USE_OWN_TOKEN)
|
||||||
|
set (QT_USED_COMPONENTS ${QT_USED_COMPONENTS} QtNetwork)
|
||||||
|
endif ()
|
||||||
if (ENABLE_GITREPORT)
|
if (ENABLE_GITREPORT)
|
||||||
set (QT_USED_COMPONENTS ${QT_USED_COMPONENTS} QtWebKit)
|
set (QT_USED_COMPONENTS ${QT_USED_COMPONENTS} QtWebKit)
|
||||||
endif ()
|
endif ()
|
||||||
find_package(Qt4 COMPONENTS ${QT_USED_COMPONENTS} REQUIRED)
|
find_package(Qt4 COMPONENTS ${QT_USED_COMPONENTS} REQUIRED)
|
||||||
include (${QT_USE_FILE})
|
include (${QT_USE_FILE})
|
||||||
set (QT_USED_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY})
|
set (QT_USED_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
|
||||||
|
if (ENABLE_GITHUB OR USE_OWN_TOKEN)
|
||||||
|
set (QT_USED_LIBRARIES ${QT_USED_LIBRARIES} ${QT_QTNETWORK_LIBRARY})
|
||||||
|
endif ()
|
||||||
if (ENABLE_GITREPORT)
|
if (ENABLE_GITREPORT)
|
||||||
set (QT_USED_LIBRARIES ${QT_USED_LIBRARIES} ${QT_QTWEBKIT_LIBRARY})
|
set (QT_USED_LIBRARIES ${QT_USED_LIBRARIES} ${QT_QTWEBKIT_LIBRARY})
|
||||||
endif ()
|
endif ()
|
||||||
@ -52,17 +68,19 @@ else ()
|
|||||||
qt4_wrap_ui (UI_HEADERS ${FORMS})
|
qt4_wrap_ui (UI_HEADERS ${FORMS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
source_group ("Header Files" FILES ${HEADERS})
|
||||||
|
source_group ("Source Files" FILES ${SOURCES})
|
||||||
|
source_group ("Generated Files" FILES ${MOC_SOURCES})
|
||||||
|
|
||||||
if (BUILD_AS_LIBRARY)
|
if (BUILD_AS_LIBRARY)
|
||||||
add_library (${SUBPROJECT} ${LIBPROP} ${SOURCES} ${HEADERS} ${MOC_SOURCES} ${UI_HEADERS})
|
add_library (${SUBPROJECT} SHARED ${SOURCES} ${HEADERS} ${MOC_SOURCES})
|
||||||
else ()
|
else ()
|
||||||
add_executable (${SUBPROJECT} ${UI_HEADERS} ${HEADERS} ${SOURCES} ${MOC_SOURCES})
|
add_executable (${SUBPROJECT} ${UI_HEADERS} ${HEADERS} ${SOURCES} ${MOC_SOURCES})
|
||||||
endif ()
|
endif ()
|
||||||
target_link_libraries (${SUBPROJECT} ${QT_USED_LIBRARIES})
|
target_link_libraries (${SUBPROJECT} ${QT_USED_LIBRARIES})
|
||||||
# install properties
|
# install properties
|
||||||
if (BUILD_AS_LIBRARY)
|
if (BUILD_AS_LIBRARY)
|
||||||
if (BUILD_SHARED_LIBRARY)
|
install (TARGETS ${SUBPROJECT} DESTINATION lib)
|
||||||
install (TARGETS ${SUBPROJECT} DESTINATION lib)
|
|
||||||
endif ()
|
|
||||||
else ()
|
else ()
|
||||||
install (TARGETS ${SUBPROJECT} DESTINATION bin)
|
install (TARGETS ${SUBPROJECT} DESTINATION bin)
|
||||||
endif ()
|
endif ()
|
||||||
|
@ -69,8 +69,10 @@
|
|||||||
// public link; in the most cases do not touch it
|
// public link; in the most cases do not touch it
|
||||||
// available tags are $PROJECT, $OWNER
|
// available tags are $PROJECT, $OWNER
|
||||||
#define PUBLIC_URL "https://gitreports.com/issue/$OWNER/$PROJECT"
|
#define PUBLIC_URL "https://gitreports.com/issue/$OWNER/$PROJECT"
|
||||||
// captcha url; in the most cases do not touch it
|
// captcha
|
||||||
#define CAPTCHA_URL "https://gitreports.com/simple_captcha?code="
|
#define CAPTCHA_KEY "7f6ef90bce7389088a52c5c9101aad206b21b56d"
|
||||||
|
#define CAPTCHA_TEXT "QJNZXY"
|
||||||
|
#define CAPTCHA_TIME "1406531273"
|
||||||
|
|
||||||
|
|
||||||
#endif /* CONFIG_H */
|
#endif /* CONFIG_H */
|
@ -35,6 +35,8 @@
|
|||||||
#include <QNetworkRequest>
|
#include <QNetworkRequest>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class GithubModule
|
* @class GithubModule
|
||||||
@ -42,10 +44,9 @@
|
|||||||
/**
|
/**
|
||||||
* @fn GithubModule
|
* @fn GithubModule
|
||||||
*/
|
*/
|
||||||
GithubModule::GithubModule(QWidget *parent, bool debugCmd, QMap<QString, QString> params)
|
GithubModule::GithubModule(QWidget *parent, bool debugCmd)
|
||||||
: QObject(parent),
|
: QObject(parent),
|
||||||
debug(debugCmd),
|
debug(debugCmd),
|
||||||
dynamic(params),
|
|
||||||
mainWindow((Reportabug *)parent)
|
mainWindow((Reportabug *)parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -74,12 +75,12 @@ QByteArray GithubModule::prepareRequest(const QString title, const QString body)
|
|||||||
QString fixBody = body;
|
QString fixBody = body;
|
||||||
fixBody.replace(QString("\n"), QString("<br>"));
|
fixBody.replace(QString("\n"), QString("<br>"));
|
||||||
requestList.append(QString("\"body\":\"") + fixBody + QString("\""));
|
requestList.append(QString("\"body\":\"") + fixBody + QString("\""));
|
||||||
if (!dynamic[QString("TAG_ASSIGNEE")].isEmpty())
|
if (!QString(TAG_ASSIGNEE).isEmpty())
|
||||||
requestList.append(QString("\"assignee\":\"") + parseString(dynamic[QString("TAG_ASSIGNEE")]) + QString("\""));
|
requestList.append(QString("\"assignee\":\"") + parseString(QString(TAG_ASSIGNEE)) + QString("\""));
|
||||||
if (!dynamic[QString("TAG_MILESTONE")].isEmpty())
|
if (!QString(TAG_MILESTONE).isEmpty())
|
||||||
requestList.append(QString("\"milestone\":") + dynamic[QString("TAG_MILESTONE")]);
|
requestList.append(QString("\"milestone\":") + QString(TAG_MILESTONE));
|
||||||
if (!dynamic[QString("TAG_LABELS")].isEmpty()) {
|
if (!QString(TAG_LABELS).isEmpty()) {
|
||||||
QStringList labels = dynamic[QString("TAG_LABELS")].split(QChar(','));
|
QStringList labels = QString(TAG_LABELS).split(QChar(','));
|
||||||
for (int i=0; i<labels.count(); i++)
|
for (int i=0; i<labels.count(); i++)
|
||||||
labels[i] = QString("\"") + labels[i] + QString("\"");
|
labels[i] = QString("\"") + labels[i] + QString("\"");
|
||||||
requestList.append(QString("\"labels\":[") + labels.join(QChar(',')) + QString("]"));
|
requestList.append(QString("\"labels\":[") + labels.join(QChar(',')) + QString("]"));
|
||||||
@ -104,11 +105,11 @@ QString GithubModule::parseString(QString line)
|
|||||||
|
|
||||||
if (line.contains(QString("$OWNER")))
|
if (line.contains(QString("$OWNER")))
|
||||||
line = line.split(QString("$OWNER"))[0] +
|
line = line.split(QString("$OWNER"))[0] +
|
||||||
dynamic[QString("OWNER")] +
|
QString(OWNER) +
|
||||||
line.split(QString("$OWNER"))[1];
|
line.split(QString("$OWNER"))[1];
|
||||||
if (line.contains(QString("$PROJECT")))
|
if (line.contains(QString("$PROJECT")))
|
||||||
line = line.split(QString("$PROJECT"))[0] +
|
line = line.split(QString("$PROJECT"))[0] +
|
||||||
dynamic[QString("PROJECT")] +
|
QString(PROJECT) +
|
||||||
line.split(QString("$PROJECT"))[1];
|
line.split(QString("$PROJECT"))[1];
|
||||||
|
|
||||||
return line;
|
return line;
|
||||||
@ -135,7 +136,7 @@ void GithubModule::sendReportUsingGithub(const QMap<QString, QString> info)
|
|||||||
QByteArray text = prepareRequest(info[QString("title")], info[QString("body")]);
|
QByteArray text = prepareRequest(info[QString("title")], info[QString("body")]);
|
||||||
QByteArray textSize = QByteArray::number(text.size());
|
QByteArray textSize = QByteArray::number(text.size());
|
||||||
// sending request
|
// sending request
|
||||||
QNetworkRequest request = QNetworkRequest(parseString(dynamic[QString("ISSUES_URL")]));
|
QNetworkRequest request = QNetworkRequest(parseString(QString(ISSUES_URL)));
|
||||||
request.setRawHeader("Authorization", headerData.toLocal8Bit());
|
request.setRawHeader("Authorization", headerData.toLocal8Bit());
|
||||||
request.setRawHeader("User-Agent", "reportabug");
|
request.setRawHeader("User-Agent", "reportabug");
|
||||||
request.setRawHeader("Host", "api.github.com");
|
request.setRawHeader("Host", "api.github.com");
|
||||||
@ -158,7 +159,7 @@ void GithubModule::githubFinished(QNetworkReply *reply)
|
|||||||
if (debug) qDebug() << "[GithubModule]" << "[githubFinished]" << ":" << "Error state" << reply->error();
|
if (debug) qDebug() << "[GithubModule]" << "[githubFinished]" << ":" << "Error state" << reply->error();
|
||||||
if (debug) qDebug() << "[GithubModule]" << "[githubFinished]" << ":" << "Reply size" << reply->readBufferSize();
|
if (debug) qDebug() << "[GithubModule]" << "[githubFinished]" << ":" << "Reply size" << reply->readBufferSize();
|
||||||
|
|
||||||
bool state = true;
|
int state = true;
|
||||||
QString answer = reply->readAll();
|
QString answer = reply->readAll();
|
||||||
if (debug) qDebug() << "[GithubModule]" << "[replyFinished]" << ":" << answer;
|
if (debug) qDebug() << "[GithubModule]" << "[replyFinished]" << ":" << answer;
|
||||||
QString messageBody, messageTitle;
|
QString messageBody, messageTitle;
|
||||||
@ -188,7 +189,6 @@ void GithubModule::githubFinished(QNetworkReply *reply)
|
|||||||
icon = QMessageBox::Critical;
|
icon = QMessageBox::Critical;
|
||||||
state = false;
|
state = false;
|
||||||
}
|
}
|
||||||
reply->deleteLater();
|
|
||||||
|
|
||||||
QMessageBox messageBox;
|
QMessageBox messageBox;
|
||||||
messageBox.setText(messageTitle);
|
messageBox.setText(messageTitle);
|
||||||
|
@ -59,11 +59,9 @@ public:
|
|||||||
* @brief GithubModule class constructor
|
* @brief GithubModule class constructor
|
||||||
* @param parent parent object
|
* @param parent parent object
|
||||||
* @param debugCmd show debug messages
|
* @param debugCmd show debug messages
|
||||||
* @param params dynamic parametrs. Needed keys are the same as in config.h
|
|
||||||
*/
|
*/
|
||||||
explicit GithubModule(QWidget *parent = 0,
|
explicit GithubModule(QWidget *parent = 0,
|
||||||
bool debugCmd = false,
|
bool debugCmd = false);
|
||||||
QMap<QString, QString> params = QMap<QString, QString>());
|
|
||||||
/**
|
/**
|
||||||
* @brief GithubModule class destructor
|
* @brief GithubModule class destructor
|
||||||
*/
|
*/
|
||||||
@ -93,10 +91,6 @@ private:
|
|||||||
* @brief show debug messages
|
* @brief show debug messages
|
||||||
*/
|
*/
|
||||||
bool debug;
|
bool debug;
|
||||||
/**
|
|
||||||
* @brief dynamic parametrs
|
|
||||||
*/
|
|
||||||
QMap<QString, QString> dynamic;
|
|
||||||
/**
|
/**
|
||||||
* @brief Reportabug class
|
* @brief Reportabug class
|
||||||
*/
|
*/
|
||||||
|
@ -29,14 +29,13 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QNetworkAccessManager>
|
|
||||||
#include <QNetworkReply>
|
|
||||||
#include <QNetworkRequest>
|
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QWebElement>
|
#include <QWebElement>
|
||||||
#include <QWebFrame>
|
#include <QWebFrame>
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class GitreportModule
|
* @class GitreportModule
|
||||||
@ -44,10 +43,9 @@
|
|||||||
/**
|
/**
|
||||||
* @fn GitreportModule
|
* @fn GitreportModule
|
||||||
*/
|
*/
|
||||||
GitreportModule::GitreportModule(QWidget *parent, bool debugCmd, QMap<QString, QString> params)
|
GitreportModule::GitreportModule(QWidget *parent, bool debugCmd)
|
||||||
: QObject(parent),
|
: QObject(parent),
|
||||||
debug(debugCmd),
|
debug(debugCmd),
|
||||||
dynamic(params),
|
|
||||||
mainWindow((Reportabug *)parent)
|
mainWindow((Reportabug *)parent)
|
||||||
{
|
{
|
||||||
webView = new QWebView();
|
webView = new QWebView();
|
||||||
@ -73,7 +71,9 @@ void GitreportModule::sendReportUsingGitreport(const QMap<QString, QString> info
|
|||||||
if (debug) qDebug() << "[GitreportModule]" << "[sendReportUsingGitreport]";
|
if (debug) qDebug() << "[GitreportModule]" << "[sendReportUsingGitreport]";
|
||||||
|
|
||||||
QWebElement document = webView->page()->mainFrame()->documentElement();
|
QWebElement document = webView->page()->mainFrame()->documentElement();
|
||||||
QWebElement captchaKey = document.findFirst(QString("input#captcha"));
|
QWebElement captcha = document.findFirst(QString("input#captcha"));
|
||||||
|
QWebElement captchaImg = document.findFirst(QString("img#[alt=captcha]"));
|
||||||
|
QWebElement captchaKey = document.findFirst(QString("input#captcha_key"));
|
||||||
QWebElement emailInput = document.findFirst(QString("input#email"));
|
QWebElement emailInput = document.findFirst(QString("input#email"));
|
||||||
QWebElement textArea = document.findFirst(QString("textarea#details"));
|
QWebElement textArea = document.findFirst(QString("textarea#details"));
|
||||||
QWebElement usernameInput = document.findFirst(QString("input#name"));
|
QWebElement usernameInput = document.findFirst(QString("input#name"));
|
||||||
@ -82,7 +82,12 @@ void GitreportModule::sendReportUsingGitreport(const QMap<QString, QString> info
|
|||||||
usernameInput.setAttribute(QString("value"), info[QString("username")]);
|
usernameInput.setAttribute(QString("value"), info[QString("username")]);
|
||||||
emailInput.setAttribute(QString("value"), info[QString("password")]);
|
emailInput.setAttribute(QString("value"), info[QString("password")]);
|
||||||
textArea.setPlainText(info[QString("body")]);
|
textArea.setPlainText(info[QString("body")]);
|
||||||
captchaKey.setAttribute(QString("value"), info[QString("captcha")]);
|
// captcha
|
||||||
|
captchaImg.setAttribute(QString("src"), QString("/simple_captcha?code=%1&time=%2")
|
||||||
|
.arg(QString(CAPTCHA_KEY))
|
||||||
|
.arg(QString(CAPTCHA_TIME)));
|
||||||
|
captchaKey.setAttribute(QString("value"), QString(CAPTCHA_KEY));
|
||||||
|
captcha.setAttribute(QString("value"), QString(CAPTCHA_TEXT));
|
||||||
|
|
||||||
// send request
|
// send request
|
||||||
document.findFirst(QString("input[name=commit]")).evaluateJavaScript("this.click()");
|
document.findFirst(QString("input[name=commit]")).evaluateJavaScript("this.click()");
|
||||||
@ -100,17 +105,8 @@ void GitreportModule::gitreportLoaded(const bool state)
|
|||||||
if (debug) qDebug() << "[GitreportModule]" << "[gitreportLoaded]";
|
if (debug) qDebug() << "[GitreportModule]" << "[gitreportLoaded]";
|
||||||
if (debug) qDebug() << "[GitreportModule]" << "[gitreportLoaded]" << ":" << "State" << state;
|
if (debug) qDebug() << "[GitreportModule]" << "[gitreportLoaded]" << ":" << "State" << state;
|
||||||
|
|
||||||
if (state) {
|
if (state)
|
||||||
webView->setHidden(!debug);
|
webView->setHidden(!debug);
|
||||||
// captcha
|
|
||||||
QWebElement document = webView->page()->mainFrame()->documentElement();
|
|
||||||
QWebElement captchaImg = document.findFirst(QString("input#captcha_key"));
|
|
||||||
QString captchaUrl = QString(dynamic[QString("CAPTCHA_URL")]) + captchaImg.attribute(QString("value"));
|
|
||||||
QNetworkRequest request(captchaUrl);
|
|
||||||
manager.get(request);
|
|
||||||
disconnect(&manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(setCaptcha(QNetworkReply *)));
|
|
||||||
connect(&manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(setCaptcha(QNetworkReply *)));
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
QMessageBox messageBox;
|
QMessageBox messageBox;
|
||||||
messageBox.setText(QApplication::translate("Reportabug", "Error!"));
|
messageBox.setText(QApplication::translate("Reportabug", "Error!"));
|
||||||
@ -169,20 +165,3 @@ void GitreportModule::gitreportFinished(const bool state)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @fn setCaptcha
|
|
||||||
*/
|
|
||||||
void GitreportModule::setCaptcha(QNetworkReply *reply)
|
|
||||||
{
|
|
||||||
if (debug) qDebug() << "[setCaptcha]" << "[setCaptcha]";
|
|
||||||
if (debug) qDebug() << "[setCaptcha]" << "[setCaptcha]" << ":" << "Error state" << reply->error();
|
|
||||||
if (debug) qDebug() << "[setCaptcha]" << "[setCaptcha]" << ":" << "Reply size" << reply->readBufferSize();
|
|
||||||
|
|
||||||
QByteArray answer = reply->readAll();
|
|
||||||
QPixmap captcha;
|
|
||||||
captcha.loadFromData(answer);
|
|
||||||
mainWindow->setCaptchaImage(captcha);
|
|
||||||
reply->deleteLater();
|
|
||||||
}
|
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QWebView>
|
#include <QWebView>
|
||||||
|
|
||||||
class QNetworkAccessManager;
|
|
||||||
class Reportabug;
|
class Reportabug;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -38,7 +37,7 @@ class Reportabug;
|
|||||||
* creating an issue. Please visit [this page](https://gitreports.com/)
|
* creating an issue. Please visit [this page](https://gitreports.com/)
|
||||||
* and set up it for your repository.
|
* and set up it for your repository.
|
||||||
*
|
*
|
||||||
* This module depends on QtWebKit and QtNetwork modules.
|
* This module depends on QtWebKit module.
|
||||||
*/
|
*/
|
||||||
class GitreportModule : public QObject
|
class GitreportModule : public QObject
|
||||||
{
|
{
|
||||||
@ -49,11 +48,9 @@ public:
|
|||||||
* @brief GitreportModule class constructor
|
* @brief GitreportModule class constructor
|
||||||
* @param parent parent object
|
* @param parent parent object
|
||||||
* @param debugCmd show debug messages
|
* @param debugCmd show debug messages
|
||||||
* @param params dynamic parametrs. Needed keys are the same as in config.h
|
|
||||||
*/
|
*/
|
||||||
explicit GitreportModule(QWidget *parent = 0,
|
explicit GitreportModule(QWidget *parent = 0,
|
||||||
bool debugCmd = false,
|
bool debugCmd = false);
|
||||||
QMap<QString, QString> params = QMap<QString, QString>());
|
|
||||||
/**
|
/**
|
||||||
* @brief GitreportModule class destructor
|
* @brief GitreportModule class destructor
|
||||||
*/
|
*/
|
||||||
@ -84,29 +81,16 @@ private slots:
|
|||||||
* @param bool state of web page loading
|
* @param bool state of web page loading
|
||||||
*/
|
*/
|
||||||
void gitreportLoaded(const bool state);
|
void gitreportLoaded(const bool state);
|
||||||
/**
|
|
||||||
* @brief method which will be called after loading captcha image
|
|
||||||
* @param reply reply of the request
|
|
||||||
*/
|
|
||||||
void setCaptcha(QNetworkReply *reply);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* @brief show debug messages
|
* @brief show debug messages
|
||||||
*/
|
*/
|
||||||
bool debug;
|
bool debug;
|
||||||
/**
|
|
||||||
* @brief dynamic parametrs
|
|
||||||
*/
|
|
||||||
QMap<QString, QString> dynamic;
|
|
||||||
/**
|
/**
|
||||||
* @brief Reportabug class
|
* @brief Reportabug class
|
||||||
*/
|
*/
|
||||||
Reportabug *mainWindow;
|
Reportabug *mainWindow;;
|
||||||
/**
|
|
||||||
* @brief manager for getting captcha
|
|
||||||
*/
|
|
||||||
QNetworkAccessManager manager;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,41 +44,11 @@
|
|||||||
/**
|
/**
|
||||||
* @fn Reportabug
|
* @fn Reportabug
|
||||||
*/
|
*/
|
||||||
Reportabug::Reportabug(QWidget *parent, bool debugCmd, QMap<QString, QString> params)
|
Reportabug::Reportabug(QWidget *parent, bool debugCmd)
|
||||||
: QMainWindow(parent),
|
: QMainWindow(parent),
|
||||||
debug(debugCmd),
|
debug(debugCmd),
|
||||||
dynamic(params),
|
|
||||||
ui(new Ui::Reportabug)
|
ui(new Ui::Reportabug)
|
||||||
{
|
{
|
||||||
// read settings
|
|
||||||
// main
|
|
||||||
if (!dynamic.contains(QString("OWNER")))
|
|
||||||
dynamic[QString("OWNER")] = QString(OWNER);
|
|
||||||
if (!dynamic.contains(QString("PROJECT")))
|
|
||||||
dynamic[QString("PROJECT")] = QString(PROJECT);
|
|
||||||
if (!dynamic.contains(QString("TAG_ASSIGNEE")))
|
|
||||||
dynamic[QString("TAG_ASSIGNEE")] = QString(TAG_ASSIGNEE);
|
|
||||||
if (!dynamic.contains(QString("TAG_BODY")))
|
|
||||||
dynamic[QString("TAG_BODY")] = QString(TAG_BODY);
|
|
||||||
if (!dynamic.contains(QString("TAG_LABELS")))
|
|
||||||
dynamic[QString("TAG_LABELS")] = QString(TAG_LABELS);
|
|
||||||
if (!dynamic.contains(QString("TAG_MILESTONE")))
|
|
||||||
dynamic[QString("TAG_MILESTONE")] = QString(TAG_MILESTONE);
|
|
||||||
if (!dynamic.contains(QString("TAG_TITLE")))
|
|
||||||
dynamic[QString("TAG_TITLE")] = QString(TAG_TITLE);
|
|
||||||
// github module
|
|
||||||
if (!dynamic.contains(QString("GITHUB_COMBOBOX")))
|
|
||||||
dynamic[QString("GITHUB_COMBOBOX")] = QString(GITHUB_COMBOBOX);
|
|
||||||
if (!dynamic.contains(QString("ISSUES_URL")))
|
|
||||||
dynamic[QString("ISSUES_URL")] = QString(ISSUES_URL);
|
|
||||||
// gitreport module
|
|
||||||
if (!dynamic.contains(QString("CAPTCHA_URL")))
|
|
||||||
dynamic[QString("CAPTCHA_URL")] = QString(CAPTCHA_URL);
|
|
||||||
if (!dynamic.contains(QString("GITREPORT_COMBOBOX")))
|
|
||||||
dynamic[QString("GITREPORT_COMBOBOX")] = QString(GITREPORT_COMBOBOX);
|
|
||||||
if (!dynamic.contains(QString("PUBLIC_URL")))
|
|
||||||
dynamic[QString("PUBLIC_URL")] = QString(PUBLIC_URL);
|
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
initModules();
|
initModules();
|
||||||
createComboBox();
|
createComboBox();
|
||||||
@ -114,17 +84,6 @@ void Reportabug::externalUpdateTab()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @fn setCaptchaImage
|
|
||||||
*/
|
|
||||||
void Reportabug::setCaptchaImage(QPixmap captcha)
|
|
||||||
{
|
|
||||||
if (debug) qDebug() << "[Reportabug]" << "[setCaptchaImage]";
|
|
||||||
|
|
||||||
ui->label_captcha->setPixmap(captcha);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fn createActions
|
* @fn createActions
|
||||||
*/
|
*/
|
||||||
@ -147,9 +106,9 @@ void Reportabug::createComboBox()
|
|||||||
|
|
||||||
ui->comboBox->clear();
|
ui->comboBox->clear();
|
||||||
if (modules[0])
|
if (modules[0])
|
||||||
ui->comboBox->addItem(dynamic[QString("GITHUB_COMBOBOX")]);
|
ui->comboBox->addItem(QApplication::translate("Reportabug", GITHUB_COMBOBOX));
|
||||||
if (modules[1] || modules[2])
|
if (modules[1] || modules[2])
|
||||||
ui->comboBox->addItem(dynamic[QString("GITREPORT_COMBOBOX")]);
|
ui->comboBox->addItem(QApplication::translate("Reportabug", GITREPORT_COMBOBOX));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -208,7 +167,7 @@ void Reportabug::initModules()
|
|||||||
modules[1] = true;
|
modules[1] = true;
|
||||||
gitreport = new GitreportModule(this, debug);
|
gitreport = new GitreportModule(this, debug);
|
||||||
// 4 is a magic number. Seriously
|
// 4 is a magic number. Seriously
|
||||||
ui->verticalLayout->insertWidget(5, gitreport->webView);
|
ui->verticalLayout->insertWidget(4, gitreport->webView);
|
||||||
#endif /* ENABLE_GITREPORT */
|
#endif /* ENABLE_GITREPORT */
|
||||||
#ifdef OWN_GITHUB_TOKEN
|
#ifdef OWN_GITHUB_TOKEN
|
||||||
modules[2] = true;
|
modules[2] = true;
|
||||||
@ -238,11 +197,11 @@ QString Reportabug::parseString(QString line)
|
|||||||
|
|
||||||
if (line.contains(QString("$OWNER")))
|
if (line.contains(QString("$OWNER")))
|
||||||
line = line.split(QString("$OWNER"))[0] +
|
line = line.split(QString("$OWNER"))[0] +
|
||||||
dynamic[QString("OWNER")] +
|
QString(OWNER) +
|
||||||
line.split(QString("$OWNER"))[1];
|
line.split(QString("$OWNER"))[1];
|
||||||
if (line.contains(QString("$PROJECT")))
|
if (line.contains(QString("$PROJECT")))
|
||||||
line = line.split(QString("$PROJECT"))[0] +
|
line = line.split(QString("$PROJECT"))[0] +
|
||||||
dynamic[QString("PROJECT")] +
|
QString(PROJECT) +
|
||||||
line.split(QString("$PROJECT"))[1];
|
line.split(QString("$PROJECT"))[1];
|
||||||
|
|
||||||
return line;
|
return line;
|
||||||
@ -259,7 +218,6 @@ void Reportabug::sendReport()
|
|||||||
int number = getNumberByIndex(ui->comboBox->currentIndex());
|
int number = getNumberByIndex(ui->comboBox->currentIndex());
|
||||||
QMap<QString, QString> info;
|
QMap<QString, QString> info;
|
||||||
info[QString("body")] = ui->textEdit->toPlainText();
|
info[QString("body")] = ui->textEdit->toPlainText();
|
||||||
info[QString("captcha")] = ui->lineEdit_captcha->text();
|
|
||||||
info[QString("password")] = ui->lineEdit_password->text();
|
info[QString("password")] = ui->lineEdit_password->text();
|
||||||
info[QString("title")] = ui->lineEdit_title->text();
|
info[QString("title")] = ui->lineEdit_title->text();
|
||||||
info[QString("username")] = ui->lineEdit_username->text();
|
info[QString("username")] = ui->lineEdit_username->text();
|
||||||
@ -304,9 +262,8 @@ void Reportabug::updateTabs(const int index)
|
|||||||
int number = getNumberByIndex(index);
|
int number = getNumberByIndex(index);
|
||||||
ui->lineEdit_username->clear();
|
ui->lineEdit_username->clear();
|
||||||
ui->lineEdit_password->clear();
|
ui->lineEdit_password->clear();
|
||||||
ui->lineEdit_title->setText(dynamic[QString("TAG_TITLE")]);
|
ui->lineEdit_title->setText(QString(TAG_TITLE));
|
||||||
ui->textEdit->setPlainText(dynamic[QString("TAG_BODY")]);
|
ui->textEdit->setPlainText(QString(TAG_BODY));
|
||||||
ui->lineEdit_captcha->clear();
|
|
||||||
|
|
||||||
// it is out of conditional because I don't want a lot of ifdef/endif
|
// it is out of conditional because I don't want a lot of ifdef/endif
|
||||||
#ifdef ENABLE_GITREPORT
|
#ifdef ENABLE_GITREPORT
|
||||||
@ -316,14 +273,12 @@ void Reportabug::updateTabs(const int index)
|
|||||||
ui->widget_auth->setHidden(true);
|
ui->widget_auth->setHidden(true);
|
||||||
ui->widget_title->setHidden(true);
|
ui->widget_title->setHidden(true);
|
||||||
ui->textEdit->setHidden(true);
|
ui->textEdit->setHidden(true);
|
||||||
ui->widget_captcha->setHidden(true);
|
|
||||||
}
|
}
|
||||||
#ifdef ENABLE_GITHUB
|
#ifdef ENABLE_GITHUB
|
||||||
else if (number == 0) {
|
else if (number == 0) {
|
||||||
ui->widget_auth->setHidden(false);
|
ui->widget_auth->setHidden(false);
|
||||||
ui->widget_title->setHidden(false);
|
ui->widget_title->setHidden(false);
|
||||||
ui->textEdit->setHidden(false);
|
ui->textEdit->setHidden(false);
|
||||||
ui->widget_captcha->setHidden(true);
|
|
||||||
ui->label_password->setText(QApplication::translate("Reportabug", "Password"));
|
ui->label_password->setText(QApplication::translate("Reportabug", "Password"));
|
||||||
ui->label_password->setToolTip(QApplication::translate("Reportabug", "GitHub account password"));
|
ui->label_password->setToolTip(QApplication::translate("Reportabug", "GitHub account password"));
|
||||||
ui->lineEdit_password->setPlaceholderText(QApplication::translate("Reportabug", "password"));
|
ui->lineEdit_password->setPlaceholderText(QApplication::translate("Reportabug", "password"));
|
||||||
@ -335,13 +290,12 @@ void Reportabug::updateTabs(const int index)
|
|||||||
ui->widget_auth->setHidden(false);
|
ui->widget_auth->setHidden(false);
|
||||||
ui->widget_title->setHidden(true);
|
ui->widget_title->setHidden(true);
|
||||||
ui->textEdit->setHidden(false);
|
ui->textEdit->setHidden(false);
|
||||||
ui->widget_captcha->setHidden(false);
|
|
||||||
ui->label_password->setText(QApplication::translate("Reportabug", "Email"));
|
ui->label_password->setText(QApplication::translate("Reportabug", "Email"));
|
||||||
ui->label_password->setToolTip(QApplication::translate("Reportabug", "Your email"));
|
ui->label_password->setToolTip(QApplication::translate("Reportabug", "Your email"));
|
||||||
ui->lineEdit_password->setPlaceholderText(QApplication::translate("Reportabug", "email"));
|
ui->lineEdit_password->setPlaceholderText(QApplication::translate("Reportabug", "email"));
|
||||||
ui->lineEdit_password->setEchoMode(QLineEdit::Normal);
|
ui->lineEdit_password->setEchoMode(QLineEdit::Normal);
|
||||||
|
|
||||||
gitreport->webView->load(QUrl(parseString(dynamic[QString("PUBLIC_URL")])));
|
gitreport->webView->load(QUrl(parseString(QString(PUBLIC_URL))));
|
||||||
disconnect(gitreport->webView, SIGNAL(loadFinished(bool)), gitreport, SLOT(gitreportLoaded(bool)));
|
disconnect(gitreport->webView, SIGNAL(loadFinished(bool)), gitreport, SLOT(gitreportLoaded(bool)));
|
||||||
disconnect(gitreport->webView, SIGNAL(loadFinished(bool)), gitreport, SLOT(gitreportFinished(bool)));
|
disconnect(gitreport->webView, SIGNAL(loadFinished(bool)), gitreport, SLOT(gitreportFinished(bool)));
|
||||||
connect(gitreport->webView, SIGNAL(loadFinished(bool)), gitreport, SLOT(gitreportLoaded(bool)));
|
connect(gitreport->webView, SIGNAL(loadFinished(bool)), gitreport, SLOT(gitreportLoaded(bool)));
|
||||||
|
@ -48,11 +48,9 @@ public:
|
|||||||
* @brief Reportabug class constructor
|
* @brief Reportabug class constructor
|
||||||
* @param parent parent object
|
* @param parent parent object
|
||||||
* @param debugCmd show debug messages
|
* @param debugCmd show debug messages
|
||||||
* @param params dynamic parametrs. Needed keys are the same as in config.h
|
|
||||||
*/
|
*/
|
||||||
explicit Reportabug(QWidget *parent = 0,
|
explicit Reportabug(QWidget *parent = 0,
|
||||||
bool debugCmd = false,
|
bool debugCmd = false);
|
||||||
QMap<QString, QString> params = QMap<QString, QString>());
|
|
||||||
/**
|
/**
|
||||||
* @brief Reportabug class destructor
|
* @brief Reportabug class destructor
|
||||||
*/
|
*/
|
||||||
@ -61,11 +59,6 @@ public:
|
|||||||
* @brief method which is used for update tabs from external classes
|
* @brief method which is used for update tabs from external classes
|
||||||
*/
|
*/
|
||||||
void externalUpdateTab();
|
void externalUpdateTab();
|
||||||
/**
|
|
||||||
* @brief method which sets captcha image
|
|
||||||
* @param captcha captcha image
|
|
||||||
*/
|
|
||||||
void setCaptchaImage(QPixmap captcha);
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
/**
|
||||||
@ -87,10 +80,6 @@ private:
|
|||||||
* @brief show debug messages
|
* @brief show debug messages
|
||||||
*/
|
*/
|
||||||
bool debug;
|
bool debug;
|
||||||
/**
|
|
||||||
* @brief dynamic parametrs
|
|
||||||
*/
|
|
||||||
QMap<QString, QString> dynamic;
|
|
||||||
/**
|
/**
|
||||||
* @brief contains information about enabled modules
|
* @brief contains information about enabled modules
|
||||||
*/
|
*/
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>541</width>
|
<width>543</width>
|
||||||
<height>372</height>
|
<height>374</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -109,26 +109,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QWidget" name="widget_captcha" native="true">
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_captcha">
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="lineEdit_captcha">
|
|
||||||
<property name="placeholderText">
|
|
||||||
<string>captcha</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
|
Loading…
Reference in New Issue
Block a user