Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #10 from Foyl/dev
Browse files Browse the repository at this point in the history
1.4.1
  • Loading branch information
awthwathje authored Apr 16, 2017
2 parents b21f38f + 1aba8e6 commit 54bf2aa
Show file tree
Hide file tree
Showing 13 changed files with 331 additions and 212 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# SteaScree Changelog

## 1.4.1
* Minor UI improvement.

## 1.4.0
* Added Drag&Drop capability.
* Fixed a bug when the app crashed if QImage object was not created if the image file is corrupted or have a wrong extension. Added a new status message if there were such files in the queue and some such files were not copied.
* Fixed misleading status message when userdata directory was not found.
* Some additional minor fixes.

## 1.3.3
* Fixed a bug when personal names were not populated to the respective combobox, if there are multiple config.cfg files were found for a single user. This is completely normal, and now personal name ges extracted from the first found config. Typically, even if there are multiple configs, personal names in them are exactly the same.
* Removed some unused methods.

## 1.3.2
* Implemented check for the encoding process of incoming JPEG files. If it is a progressive, not baseline, pristine copy of file is saved to the filesystem. Otherwise, the file is internally processed by Qt, just like PNG and other supported formats. Closes issue #9.

## 1.3.1
* Well, seems like user switching never worked right. Now it does. Games listed in the combobox change on-the-fly when user ID get changed.

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

SteaScree is a simple cross-platform open-source utility app, which makes screenshots, taken without the use of Steam's in-game overlay, uploadable to the Steam Cloud. You just pick pics, a game and SteaScree will do the rest.

![screenshot](https://steascree.download/screenshot.png)

Latest installers for all platforms are always available at https://steascree.download.

Join official Steam group for the latest announcements and discussion: http://steamcommunity.com/groups/steascree.
8 changes: 5 additions & 3 deletions SteaScree.pro
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,23 @@ SOURCES += main.cpp\
mainwindow.cpp \
controller.cpp \
largefiledialog.cpp \
interfaceadjuster.cpp
interfaceadjuster.cpp \
qtreewidgetdraganddrop.cpp

HEADERS += mainwindow.h \
controller.h \
largefiledialog.h \
interfaceadjuster.h \
screenshot.h
screenshot.h \
qtreewidgetdraganddrop.h

FORMS += mainwindow.ui \
largefiledialog.ui

RESOURCES += \
images.qrc

VERSION = 1.3.1
VERSION = 1.4.1

DEFINES += APP_VERSION=\\\"$$VERSION\\\"

Expand Down
190 changes: 127 additions & 63 deletions controller.cpp

Large diffs are not rendered by default.

23 changes: 14 additions & 9 deletions controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

#include "largefiledialog.h"
#include "mainwindow.h"
#include "screenshot.h"

#include <QObject>
#include <QSettings>
#include <QTreeWidgetItem>
#include <QNetworkReply>
#include <QPushButton>
#include <QFile>


class Controller : public QObject
Expand Down Expand Up @@ -57,14 +57,18 @@ class Controller : public QObject
const quint32 steamMaxSideSize = 16000;
const quint32 steamMaxResolution = 26210175;
QString offerUpdateSetting;
QTreeWidgetDragAndDrop *treeWidget;
const QStringList imageFormatsSupported = QStringList() << "jpg" << "jpeg" << "png" << "bmp" << "tif" << "tiff";
bool someScreenshotsWereNotPrepared;

#if defined(Q_OS_WIN32)
const QString os = "Windows";
#elif defined(Q_OS_LINUX)
const QString os = "Linux";
#elif defined(Q_OS_OSX)
const QString os = "macOS";
#endif

#if defined(Q_OS_WIN32)
const QString os = "Windows";
#elif defined(Q_OS_LINUX)
const QString os = "Linux";
#elif defined(Q_OS_OSX)
const QString os = "macOS";
#endif

void pushScreenshots(QList<Screenshot> screenshotList);
void resizeAndSaveLargeScreenshot(Screenshot screenshot);
Expand All @@ -73,6 +77,7 @@ class Controller : public QObject
void checkForUpdates();
QString getPersonalNameByUserID(QString userID);
void getShortcutNames();
QString getEncodingProcessOfJpeg(QFile *file);


signals:
Expand Down Expand Up @@ -116,11 +121,11 @@ public slots:
void writeVDF();
void returnLinesState();
void clearCopyingStatusLabels();
void setSelectedUserID(QString text);
void addScreenshotsToPool(QStringList screenshotsSelected);
void prepareScreenshotListWithDecisions(QList<Screenshot> screenshotList);
void writeSettingNeverOfferUpdate();
void fillGameIDs(QString userIDCombined);
void receiveTreeWidgetPointer(QTreeWidgetDragAndDrop *receivedWidget);


private slots:
Expand Down
2 changes: 1 addition & 1 deletion interfaceadjuster.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "interfaceadjuster.h"


InterfaceAdjuster::InterfaceAdjuster(QObject *parent) : QObject(parent) // cross-platform window optimizations
InterfaceAdjuster::InterfaceAdjuster(QObject *parent) : QObject(parent) // window optimizations for different platforms
{
}

Expand Down
12 changes: 5 additions & 7 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#include "mainwindow.h"
#include "controller.h"
#include "interfaceadjuster.h"
#include "screenshot.h"

#include <QApplication>

Q_DECLARE_METATYPE(Screenshot)


// TODO: grag'n'drop screenshots
// TODO: design inconsitencies across platforms
// TODO: UI in separate thread
// TODO: multi-threading

Expand Down Expand Up @@ -116,9 +114,6 @@ int main(int argc, char *argv[])
QObject::connect(&c, &Controller::sendLabelsOnMissingStuff,
&w, &MainWindow::setLabelsOnMissingStuff);

QObject::connect(&w, &MainWindow::sendComboBoxUserIDCurrentText,
&c, &Controller::setSelectedUserID);

QObject::connect(&c, &Controller::sendLabelsText,
&w, &MainWindow::setLabelsText);

Expand All @@ -137,9 +132,12 @@ int main(int argc, char *argv[])
QObject::connect(&w, &MainWindow::sendNewlySelectedUserID,
&c, &Controller::fillGameIDs);

w.show();
QObject::connect(&w, &MainWindow::sendTreeWidgetPointer,
&c, &Controller::receiveTreeWidgetPointer);

w.bootStrap();
c.bootStrap();
w.show();

return a.exec();
}
29 changes: 17 additions & 12 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include <QMovie>
#include <QDesktopServices>

#include <QDebug>


MainWindow::MainWindow(QWidget *parent) :

Expand Down Expand Up @@ -50,11 +52,14 @@ void MainWindow::bootStrap()
ui->progressBar_status->setSizePolicy(spRetain);

emit sendButtonList(QList<QPushButton*>() << ui->pushButton_clearQueue << ui->pushButton_copyScreenshots // buttons should have specific padding
<< ui->pushButton_addScreenshots << ui->pushButton_prepare); // ...in each supported OS
<< ui->pushButton_addScreenshots << ui->pushButton_prepare); // ...in each supported OS

userIDComboBox = ui->comboBox_userID;
QObject::connect(userIDComboBox, static_cast<void(QComboBox::*)(const QString &)>(&QComboBox::activated),
this, &MainWindow::reactToComboBoxActivation);

QTreeWidgetDragAndDrop *treeWidget = ui->treeWidget_screenshotList;
emit sendTreeWidgetPointer(treeWidget);
}


Expand Down Expand Up @@ -87,9 +92,9 @@ void MainWindow::makeWideMessageBox(QMessageBox *msgBox, quint32 width) // hack
void MainWindow::locateSteamDir(QString steamDir)
{
QString steamDirLocated = QFileDialog::getExistingDirectory(this,
"Locate Steam directory",
steamDir,
QFileDialog::ShowDirsOnly | QFileDialog::ReadOnly);
"Locate Steam directory",
steamDir,
QFileDialog::ShowDirsOnly | QFileDialog::ReadOnly);
if ( !steamDirLocated.isEmpty() ) {

steamDirLocated.remove(QRegularExpression("/userdata$"));
Expand Down Expand Up @@ -214,7 +219,7 @@ void MainWindow::setLabelsOnMissingStuff(bool userDataMissing, QString vdfFilena
{
ui->label_status->setVisible(true);
if ( userDataMissing )
setStatusLabelText("Steam executable is found, but there is no userdata directory", "#ab4e52");
setStatusLabelText("Steam userdata directory is not found", "#ab4e52");
else
setStatusLabelText("Steam userdata directory is found, but " + vdfFilename + " is missing", "#ab4e52");

Expand All @@ -226,32 +231,32 @@ void MainWindow::setLabelsOnMissingStuff(bool userDataMissing, QString vdfFilena
void MainWindow::returnScreenshotsSelected(QString lastSelectedScreenshotDir)
{
QStringList screenshotsSelected = QFileDialog::getOpenFileNames(this,
"Select one or more screenshots",
lastSelectedScreenshotDir,
"Images (*.jpg *.jpeg *.png *.bmp *.tif *.tiff)");
"Select one or several screenshots",
lastSelectedScreenshotDir,
"Images (*.jpg *.jpeg *.png *.bmp *.tif *.tiff)");
emit sendScreenshotsSelected(screenshotsSelected);
}


void MainWindow::setProgressBarValue(quint32 value)
{
ui->progressBar_status->setValue(value);
ui->progressBar_status->setValue(value);
}


void MainWindow::deleteCopiedWidgetItem(QString path)
{
QFile file(path);
QTreeWidgetItem *item = ui->treeWidget_screenshotList->findItems(QFileInfo(file).lastModified()
.toString("yyyy/MM/dd hh:mm:ss"), Qt::MatchExactly, 1)[0];
.toString("yyyy/MM/dd hh:mm:ss"), Qt::MatchExactly, 1)[0];
delete item;
}


void MainWindow::disableAllControls()
{
setWidgetsDisabled(QStringList() << "pushButton_clearQueue" << "pushButton_addScreenshots" << "pushButton_copyScreenshots"
<< "pushButton_locateSteamDir" << "comboBox_userID" << "comboBox_gameID" << "pushButton_prepare", true);
<< "pushButton_locateSteamDir" << "comboBox_userID" << "comboBox_gameID" << "pushButton_prepare", true);
}


Expand Down Expand Up @@ -330,7 +335,7 @@ void MainWindow::on_pushButton_addScreenshots_clicked()


void MainWindow::on_pushButton_clearQueue_clicked()
{
{
ui->treeWidget_screenshotList->clear();

setWidgetsDisabled(QStringList() << "pushButton_clearQueue" << "pushButton_copyScreenshots", true);
Expand Down
5 changes: 4 additions & 1 deletion mainwindow.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "qtreewidgetdraganddrop.h"

#include <QMainWindow>
#include <QTreeWidgetItem>
#include <QMessageBox>
Expand Down Expand Up @@ -38,6 +40,7 @@ class MainWindow : public QMainWindow
void disableAllControls();



signals:
void sendButtonList(QList<QPushButton*> buttonList);
void pushButton_addScreenshots_clicked();
Expand All @@ -52,10 +55,10 @@ class MainWindow : public QMainWindow
void writeVDF();
void getVDFStatus();
void sendSettings(QSize size, QPoint pos, QString userID, QString userIDComboBox);
void sendComboBoxUserIDCurrentText(QString text);
void sendScreenshotsSelected(QStringList screenshotsSelected);
void sendNeverOfferUpdate();
void sendNewlySelectedUserID(QString userID);
void sendTreeWidgetPointer(QTreeWidgetDragAndDrop *treeWidget);


public slots:
Expand Down
Loading

0 comments on commit 54bf2aa

Please sign in to comment.