Commit e0ea7aa9 authored by Philip Rinn's avatar Philip Rinn

Imported Upstream version 1.0.5

parent 2b1b21b6
install:
- set QTDIR=C:\Qt\5.5\mingw492_32
- choco install -y InnoSetup
- set PATH=%QTDIR%\bin;C:\MinGW\bin;%PATH%;"C:\Program Files (x86)\Inno Setup 5"
build_script:
- qmake qtpass.pro CONFIG+=static
- mingw32-make
after_build:
- cmd: copy README.md release\README.txt
- cmd: copy LICENSE release\LICENSE.txt
- iscc qtpass.iss
artifacts:
- path: Output\QtPass_v*.exe
deploy:
provider: GitHub
auth_token:
secure: YfscG1DR0+kApThPXxQSr+ZEjUOUlIG0Tqc5+90IFsUInyICRRMdbJsbxR2qhq/p
artifact: /QtPass_v[0-9]+\.[0-9]+\.[0-9]+\.exe/
draft: true
prerelease: false
on:
appveyor_repo_tag: true
......@@ -14,3 +14,4 @@ qtpass.xcworkspace/xcuserdata/*
moc_*.cpp
qrc_*.cpp
ui_*.h
localization/*.qm
language: cpp
sudo: false
os:
- linux
- osx
- linux
- osx
compiler:
- gcc
- clang
- gcc
- clang
addons:
apt:
packages:
- qt5-default
install:
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew ls | grep -wq qt5 || brew install qt5; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export PATH=$PATH:/usr/local/opt/qt5/bin; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew ls | grep -wq qt5 || brew install qt5;
fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export PATH=$PATH:/usr/local/opt/qt5/bin;
fi
env:
global:
secure: WaZq3f6KIAc0dnR4WOXYWDvUYiqlrzsZC/PQse47FnvC0oQC65J5w3kJOj/P26DgsUEqKQF3ukXogkM2mp5pS4+CMgivEmQmAbgQTtwcKpC5HPZxgI+8FgkCjcalJKWGWYoxlScNVNiKMs+89ApcSQE9kH9PZeUS9dukN2Php1U=
addons:
coverity_scan:
project:
name: "IJHack/qtpass"
description: "Build submitted via Travis CI"
notification_email: brouwer@annejan.com
build_command_prepend: "qmake; make clean"
build_command: "make"
branch_pattern: coverity_scan
script:
- qmake -v
- qmake -Wall qtpass.pro
- make -j$(nproc)
- qmake -v
- qmake -Wall qtpass.pro
- make -j$(nproc)
notifications:
irc:
irc:
channels:
- "chat.freenode.net#IJhack"
- chat.freenode.net#IJhack
on_success: change
on_failure: always
# Contributing
Make sure you have read the [FAQ](FAQ.md)
Thank you for wanting to contribute to making QtPass awesome.
## This document
This document is stil in a very early stage and needs a lot more work.
## Translations
* Add you language to the `qtpass.pro` file under TRANSLATIONS and in the `resources.qrc` file.
* Next run the command `lupdate qtpass.pro` which will create the localization files.
* Edit your file with (let's imagine your language is sv_SE (Swedish) `linguist localization/localization_sv_SE.ts`
Qt Linguist has very nice in-context translation options https://doc-snapshots.qt.io/qt5-5.6/linguist-translators.html
## IRC
For questions or brainstorming about features please join #ijhack on freenode.
......@@ -30,6 +30,10 @@ fi
* More info: [issue 60](https://github.com/IJHack/qtpass/issues/60) and [issue 73](https://github.com/IJHack/qtpass/issues/73)
### I don't get a passphrase / PIN dialog
* You'll need to install pinentry-qt (or -qt4 or -qt5 or even -gtk) and possibly set the full path to that executable in your `~/.gnupg/gpg-agent.conf` for example: `pinentry-program /usr/bin/pinentry-qt4`
* On some esotheric systems it might be necessary to create a symbolic link `/usr/bin/pinentry` to your pinentry application of choice eg: `ln -s /usr/bin/pinentry-qt5 /usr/bin/pinentry`
### Where can I ask for help?
* Create an [issue](https://github.com/IJHack/qtpass/) issues on github.
* Send an email to [help@qtpass.org](help@qtpass.org)
......@@ -43,7 +47,6 @@ fi
## How can I help improve QtPass?
###I would like to donate!
* Time:
......
QtPass [![Build Status](https://travis-ci.org/IJHack/qtpass.svg?branch=master)](https://travis-ci.org/IJHack/qtpass)
QtPass [![Build Status](https://travis-ci.org/IJHack/qtpass.svg?branch=master)](https://travis-ci.org/IJHack/qtpass) [![Build status](https://ci.appveyor.com/api/projects/status/9rjnj72rdir7u9eg/branch/master?svg=true)](https://ci.appveyor.com/project/annejan/qtpass/branch/master)
======
QtPass is a GUI for [pass](http://www.passwordstore.org/), the standard unix password manager.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -16,10 +16,11 @@ int main(int argc, char *argv[])
QString name = qgetenv("USER");
if (name.isEmpty())
name = qgetenv("USERNAME");
//qDebug() << name;
SingleApplication app(argc, argv, name + "QtPass");
if (app.isRunning()) {
app.sendMessage(text);
if (text.length() > 0) {
app.sendMessage(text);
}
return 0;
}
#else
......@@ -31,12 +32,12 @@ int main(int argc, char *argv[])
QCoreApplication::setApplicationName("QtPass");
QCoreApplication::setApplicationVersion(VERSION);
//Setup and load translator for localization
// Setup and load translator for localization
QTranslator translator;
QString locale = QLocale::system().name();
//locale = "nl_NL";
//locale = "he_IL";
//locale = "ar_MA";
// locale = "nl_NL";
// locale = "he_IL";
// locale = "ar_MA";
translator.load(QString(":localization/localization_") + locale + QString(".qm"));
app.installTranslator(&translator);
app.setLayoutDirection(QObject::tr("LTR")=="RTL" ? Qt::RightToLeft : Qt::LeftToRight);
......
......@@ -49,6 +49,7 @@ MainWindow::MainWindow(QWidget *parent) :
QApplication::quit();
}
QtPass = NULL;
autoclearTimer = NULL;
QTimer::singleShot(10, this, SLOT(focusInput()));
}
......@@ -267,6 +268,7 @@ bool MainWindow::checkConfig() {
} else {
usePwgen = false;
}
passTemplate = "login\nurl";
} else {
// QStringList ver = version.split(".");
// qDebug() << ver;
......@@ -276,7 +278,11 @@ bool MainWindow::checkConfig() {
if (passwordChars.isEmpty()) {
passwordChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890~!@#$%^&*()_-+={}[]|:;<>,.?";
}
if (passTemplate.isEmpty()) {
passTemplate = "login\nurl";
}
}
settings.setValue("version", VERSION);
if (Util::checkConfig(passStore, passExecutable, gpgExecutable)) {
......@@ -588,6 +594,9 @@ void MainWindow::executePass(QString args, QString input) {
executeWrapper(passExecutable, args, input);
}
/**
* @brief MainWindow::executePassGitInit
*/
void MainWindow::executePassGitInit() {
qDebug() << "Pass git init called";
if (usePass) {
......@@ -626,9 +635,15 @@ void MainWindow::executeWrapper(QString app, QString args, QString input) {
wrapperRunning = true;
process->setWorkingDirectory(passStore);
process->setEnvironment(env);
clearTemplateWidgets();
ui->textBrowser->clear();
ui->textBrowser->setTextColor(Qt::black);
enableUiElements(false);
if (autoclearTimer != NULL) {
autoclearTimer->stop();
delete autoclearTimer;
autoclearTimer = NULL;
}
process->start('"' + app + "\" " + args);
if (!input.isEmpty()) {
process->write(input.toUtf8());
......@@ -658,10 +673,6 @@ void MainWindow::readyRead(bool finished = false) {
clippedPass = tokens[0];
QTimer::singleShot(1000*autoclearSeconds, this, SLOT(clearClipboard()));
}
if (useAutoclearPanel) {
QTimer::singleShot(1000*autoclearPanelSeconds, this, SLOT(clearPanel()));
}
if (hidePassword && !useTemplate) {
tokens[0] = "***" + tr("Password hidden") + "***";
output = tokens.join("\n");
......@@ -713,12 +724,15 @@ void MainWindow::readyRead(bool finished = false) {
}
output = tokens.join("\n");
} else {
while(ui->formLayout->count() > 0){
QLayoutItem *item = ui->formLayout->takeAt(0);
delete item->widget();
delete item;
}
ui->verticalLayoutPassword->setSpacing(0);
clearTemplateWidgets();
}
if (useAutoclearPanel) {
autoclearPass = output;
autoclearTimer = new QTimer(this);
autoclearTimer->setSingleShot(true);
autoclearTimer->setInterval(1000*autoclearPanelSeconds);
connect(autoclearTimer, SIGNAL(timeout()), this, SLOT(clearPanel()));
autoclearTimer->start();
}
}
output.replace(QRegExp("<"), "&lt;");
......@@ -735,7 +749,12 @@ void MainWindow::readyRead(bool finished = false) {
}
if (!error.isEmpty()) {
output = "<span style=\"color: red;\">" + error + "</span><br />" + output;
if (currentAction == GIT) {
// https://github.com/IJHack/qtpass/issues/111
output = "<span style=\"color: darkgray;\">" + error + "</span><br />" + output;
} else {
output = "<span style=\"color: red;\">" + error + "</span><br />" + output;
}
}
output.replace(QRegExp("((?:https?|ftp)://\\S+)"), "<a href=\"\\1\">\\1</a>");
......@@ -748,7 +767,6 @@ void MainWindow::readyRead(bool finished = false) {
/**
* @brief MainWindow::clearClipboard
* @TODO check clipboard content (only clear if contains the password)
*/
void MainWindow::clearClipboard()
{
......@@ -1642,7 +1660,7 @@ QString MainWindow::generatePassword() {
executeWrapper(pwgenExecutable, args);
process->waitForFinished(1000);
if (process->exitStatus() == QProcess::NormalExit) {
passwd = QString(process->readAllStandardOutput());
passwd = QString(process->readAllStandardOutput()).remove(QRegExp("[\\n\\r]"));
} else {
qDebug() << "pwgen fail";
}
......@@ -1663,6 +1681,10 @@ QString MainWindow::generatePassword() {
return passwd;
}
/**
* @brief MainWindow::waitFor
* @param seconds
*/
void MainWindow::waitFor(int seconds)
{
QDateTime current = QDateTime::currentDateTime();
......@@ -1677,3 +1699,16 @@ void MainWindow::waitFor(int seconds)
Util::qSleep(100);
}
}
/**
* @brief MainWindow::clearTemplateWidgets
*/
void MainWindow::clearTemplateWidgets()
{
while(ui->formLayout->count() > 0){
QLayoutItem *item = ui->formLayout->takeAt(0);
delete item->widget();
delete item;
}
ui->verticalLayoutPassword->setSpacing(0);
}
......@@ -7,6 +7,7 @@
#include <QProcess>
#include <QQueue>
#include <QSettings>
#include <QTimer>
#include "storemodel.h"
#include "trayicon.h"
#if SINGLE_APP
......@@ -106,6 +107,8 @@ private:
QString webDavPassword;
QProcess fusedav;
QString clippedPass;
QString autoclearPass;
QTimer *autoclearTimer;
actionType currentAction;
QString lastDecrypt;
bool wrapperRunning;
......@@ -151,6 +154,7 @@ private:
void destroyTrayIcon();
bool removeDir(const QString & dirName);
void waitFor(int);
void clearTemplateWidgets();
};
#endif // MAINWINDOW_H
......@@ -9,6 +9,8 @@ PasswordDialog::PasswordDialog(MainWindow *parent) :
ui(new Ui::PasswordDialog)
{
mainWindow = parent;
templating = false;
allFields = false;
ui->setupUi(this);
}
......@@ -39,6 +41,7 @@ void PasswordDialog::setPassword(QString password)
ui->lineEditPassword->setText(tokens[0]);
tokens.pop_front();
if (templating) {
QWidget *previous = ui->checkBoxShow;
for (int i = 0; i < ui->formLayout->rowCount(); i++) {
QLayoutItem *item = ui->formLayout->itemAt(i, QFormLayout::FieldRole);
if (item == NULL) {
......@@ -53,6 +56,7 @@ void PasswordDialog::setPassword(QString password)
((QLineEdit*)widget)->setText(value);
}
}
previous = widget;
}
if (allFields) {
for (int j = 0; j < tokens.length(); j++) {
......@@ -68,6 +72,8 @@ void PasswordDialog::setPassword(QString password)
line->setObjectName(field);
line->setText(value);
ui->formLayout->addRow(new QLabel(field), line);
setTabOrder(previous, line);
previous = line;
tokens.removeAt(j);
j--; // tokens.length() also got shortened by the remove..
}
......@@ -98,6 +104,7 @@ QString PasswordDialog::getPassword()
void PasswordDialog::setTemplate(QString rawFields) {
fields = rawFields.split('\n');
QWidget *previous = ui->checkBoxShow;
foreach (QString field, fields) {
if (field.isEmpty()) {
continue;
......@@ -105,6 +112,8 @@ void PasswordDialog::setTemplate(QString rawFields) {
QLineEdit *line = new QLineEdit();
line->setObjectName(field);
ui->formLayout->addRow(new QLabel(field), line);
setTabOrder(previous, line);
previous = line;
}
}
......
......@@ -2,11 +2,13 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "QtPass"
#define MyAppVersion "1.0.4"
#define MyAppVersion "1.0.5"
#define MyAppPublisher "IJhack"
#define MyAppURL "https://qtpass.org/"
#define MyAppExeName "qtpass.exe"
#define QtDir GetEnv('QTDIR')
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
......@@ -21,8 +23,8 @@ AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
LicenseFile=..\..\Desktop\QtPass\LICENSE.txt
OutputBaseFilename=setup
LicenseFile=release\LICENSE.txt
OutputBaseFilename={#MyAppName}_v{#MyAppVersion}
Compression=lzma
SolidCompression=yes
ShowLanguageDialog=no
......@@ -60,20 +62,21 @@ Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "..\..\Desktop\QtPass\qtpass.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\Desktop\QtPass\Qt5Gui.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\Desktop\QtPass\Qt5Network.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\Desktop\QtPass\Qt5Widgets.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\Desktop\QtPass\README.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\Desktop\QtPass\icudt54.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\Desktop\QtPass\icuin54.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\Desktop\QtPass\icuuc54.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\Desktop\QtPass\libgcc_s_dw2-1.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\Desktop\QtPass\libstdc++-6.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\Desktop\QtPass\libwinpthread-1.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\Desktop\QtPass\LICENSE.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\Desktop\QtPass\Qt5Core.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\Desktop\QtPass\platforms\qwindows.dll"; DestDir: "{app}\platforms\"; Flags: ignoreversion
Source: "{#QtDir}\bin\Qt5Gui.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#QtDir}\bin\Qt5Network.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#QtDir}\bin\Qt5Widgets.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#QtDir}\bin\icudt54.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#QtDir}\bin\icuin54.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#QtDir}\bin\icuuc54.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#QtDir}\bin\libgcc_s_dw2-1.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#QtDir}\bin\libstdc++-6.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#QtDir}\bin\libwinpthread-1.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#QtDir}\bin\Qt5Core.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#QtDir}\plugins\platforms\qwindows.dll"; DestDir: "{app}\platforms\"; Flags: ignoreversion
Source: "release\qtpass.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "release\README.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "release\LICENSE.txt"; DestDir: "{app}"; Flags: ignoreversion
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
......
......@@ -7,26 +7,10 @@
# #
#----------------------------------------------------------
VERSION = 1.0.4
VERSION = 1.0.5
TEMPLATE = app
QT += core gui
isEmpty(QMAKE_LRELEASE) {
win32|os2:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe
else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
unix {
!exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease-qt4 }
} else {
!exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease }
}
}
updateqm.input = TRANSLATIONS
updateqm.output = localization/${QMAKE_FILE_BASE}.qm
updateqm.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm localization/${QMAKE_FILE_BASE}.qm
updateqm.CONFIG += no_link target_predeps
QMAKE_EXTRA_COMPILERS += updateqm
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
macx {
......@@ -89,6 +73,34 @@ TRANSLATIONS += localization/localization_nl_NL.ts \
CODECFORSRC = UTF-8
CODECFORTR = UTF-8
isEmpty(QMAKE_LRELEASE) {
win32|os2:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe
else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
unix {
!exists($$QMAKE_LRELEASE) {
greaterThan(QT_MAJOR_VERSION, 4) {
QMAKE_LRELEASE = lrelease-qt5
} else {
QMAKE_LRELEASE = lrelease-qt4
}
}
} else {
!exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease }
}
}
updateqm.input = TRANSLATIONS
updateqm.output = localization/${QMAKE_FILE_BASE}.qm
updateqm.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm localization/${QMAKE_FILE_BASE}.qm
updateqm.CONFIG += no_link target_predeps
QMAKE_EXTRA_COMPILERS += updateqm
PRE_TARGETDEPS += compiler_updateqm_make_all
win32 {
system($$QMAKE_LRELEASE qtpass.pro)
} else {
system($$QMAKE_LRELEASE $$_PRO_FILE_)
}
RESOURCES += resources.qrc
......
......@@ -5,26 +5,15 @@
<file>artwork/icon.png</file>
<file>artwork/icon.svg</file>
<file>localization/localization_ar_MA.qm</file>
<file>localization/localization_ar_MA.ts</file>
<file>localization/localization_de_DE.qm</file>
<file>localization/localization_de_DE.ts</file>
<file>localization/localization_es_ES.qm</file>
<file>localization/localization_es_ES.ts</file>
<file>localization/localization_gl_ES.qm</file>
<file>localization/localization_gl_ES.ts</file>
<file>localization/localization_hu_HU.qm</file>
<file>localization/localization_hu_HU.ts</file>
<file>localization/localization_nl_NL.qm</file>
<file>localization/localization_nl_NL.ts</file>
<file>localization/localization_sv_SE.qm</file>
<file>localization/localization_sv_SE.ts</file>
<file>localization/localization_pl_PL.qm</file>
<file>localization/localization_pl_PL.ts</file>
<file>localization/localization_ru_RU.qm</file>
<file>localization/localization_ru_RU.ts</file>
<file>localization/localization_zh_CN.qm</file>
<file>localization/localization_zh_CN.ts</file>
<file>localization/localization_he_IL.ts</file>
<file>localization/localization_he_IL.qm</file>
</qresource>
</RCC>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment