Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feature/merge-db-#22
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/gui/MainWindow.cpp
  • Loading branch information
droidmonkey committed Oct 29, 2016
2 parents 758ba9e + 3f80134 commit aa6994d
Show file tree
Hide file tree
Showing 17 changed files with 228 additions and 81 deletions.
68 changes: 65 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ These are just guidelines, not rules. Use your best judgment, and feel free to p
* [Translations](#translations)

[Styleguides](#styleguides)
* [Git Branch Strategy](#git_branch_strategy)
* [Git Commit Messages](#git-commit-messages)
* [C Styleguide](#c-styleguide)
* [Coding Styleguide](#coding-styleguide)


## What should I know before I get started?
Expand Down Expand Up @@ -76,7 +77,7 @@ Both issue lists are sorted by total number of comments. While not perfect, numb

Along with our desire to hear your feedback and suggestions, we're also interested in accepting direct assistance in the form of code.

All pull requests must comply with the above requirements.
All pull requests must comply with the above requirements and with the [Styleguides](#styleguides).

### Translations

Expand All @@ -85,6 +86,15 @@ Please join an existing language team or request a new one if there is none.

## Styleguides

### Git Branch Strategy

The Branch Strategy is based on [git-flow-lite](http://nvie.com/posts/a-successful-git-branching-model/).

* **master** -> always points to the last release published
* **develop** -> points to the next planned release, tested and reviewed code
* **feature/**[name] -> points to brand new feature in codebase, candidate for merge into develop (subject to rebase)


### Git Commit Messages

* Use the present tense ("Add feature" not "Added feature")
Expand All @@ -108,7 +118,59 @@ Please join an existing language team or request a new one if there is none.

This project follows the [Qt Coding Style](https://wiki.qt.io/Qt_Coding_Style). All submissions are expected to follow this style.

Addendum- Class member variables must start with ```m_```
In particular Code must follow the following specific rules:

#### Naming Convention
`lowerCamelCase`

For names made of only one word, the fist letter is lowercase.
For names made of multiple concatenated words, the first letter is lowercase and each subsequent concatenated word is capitalized.

#### Indention
For C++ files (.cpp .h): 4 spaces
For Qt-UI files (.ui): 2 spaces

#### Pointers
```c
int* count;
```

#### Braces
```c
if (condition) {
doSomething();
}

void ExampleClass::exampleFunction()
{
doSomething();
}
```

#### Switch statement
```c
switch (a) {
case 1:
doSomething();
break;

default:
doSomethingElse();
break;
}
```

#### Member variables
Use prefix: `m_*`

Example: `m_variable`

#### GUI Widget names
Widget names must be related to the desired program behaviour.
Preferably end the name with the Widget Classname

Example: `<widget class="QCheckBox" name="rememberCheckBox">`



[beginner]:https://github.com/keepassxreboot/keepassx/issues?q=is%3Aopen+is%3Aissue+label%3Abeginner+label%3A%22help+wanted%22+sort%3Acomments-desc
Expand Down
26 changes: 15 additions & 11 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,21 @@
## Screenshots (if appropriate):

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
<!--- What types of changes does your code introduce? If it apply to your pull request, -->
<!--- replace all the `:negative_squared_cross_mark:` with `:white_check_mark:` -->
<!--- Everybody loves emoji -->
- :negative_squared_cross_mark: Bug fix (non-breaking change which fixes an issue)
- :negative_squared_cross_mark: New feature (non-breaking change which adds functionality)
- :negative_squared_cross_mark: Breaking change (fix or feature that would cause existing functionality to change)

## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- Go over all the following points, if it apply to your pull request, -->
<!--- replace all the `:negative_squared_cross_mark:` with `:white_check_mark:`. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the **CONTRIBUTING** document.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
<!--- Pull Requests that fail the [REQUIRED] field will likely be sent back for corrections or rejected -->
- :negative_squared_cross_mark: I have read the **CONTRIBUTING** document. [REQUIRED]
- :negative_squared_cross_mark: My code follows the code style of this project. [REQUIRED]
- :negative_squared_cross_mark: All new and existing tests passed. [REQUIRED]
- :negative_squared_cross_mark: My change requires a change to the documentation.
- :negative_squared_cross_mark: I have updated the documentation accordingly.
- :negative_squared_cross_mark: I have added tests to cover my changes.
105 changes: 89 additions & 16 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -1,28 +1,101 @@
Building:
=========
Install KeePassXR
=================

This document will guide you across the steps to install KeePassXR.
You can visit the online version of this document a the following link

https://github.com/keepassxreboot/keepassx/wiki/Install-Instruction-from-Source


Build Dependencies
==================

The following tools must exist within your PATH:

* make
* cmake (>= 2.8.12)
* g++ (>= 4.7) or clang++ (>= 3.0)

The following libraries are required:

* Qt 5 (>= 5.2): qtbase and qttools5
* libgcrypt (>= 1.6)
* zlib
* libmicrohttpd
* libxi, libxtst, qtx11extras (optional for auto-type on X11)


Prepare the Building Environment
================================

Building Environment on Linux ==> https://github.com/keepassxreboot/keepassx/wiki/Building-Environment-on-Linux
Building Environment on Windows ==> https://github.com/keepassxreboot/keepassx/wiki/Building-Environment-on-Windows
Building Environment on MacOS ==> https://github.com/keepassxreboot/keepassx/wiki/Building-Environment-on-MacOS


Build Steps
===========

To compile from source, open a **Terminal (on Linux/MacOS)** or a **MSYS2-MinGW shell (on Windows)**<br/>
**Note:** on Windows make sure you are using a **MINGW shell** by checking the label before the current path

Navigate to the path you have downloaded KeePassXR and type these commands:

```
mkdir build
cd build
cmake [CMAKE PARAMETERS] ..
make [-jX]
cmake -DWITH_TESTS=OFF
make
```

**Note:** If you are on MacOS you must add this parameter to **Cmake**, with the Qt version you have installed<br/> `-DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.6.2/lib/cmake/`

Common cmake parameters:
========================
You will have the compiled KeePassXR binary inside the `./build/src/` directory.

Common cmake parameters
```
-DCMAKE_INSTALL_PREFIX=/usr/local
-DCMAKE_VERBOSE_MAKEFILE=ON
-DCMAKE_BUILD_TYPE=<RelWithDebInfo/Debug/Release>
-DWITH_GUI_TESTS=ON
```

Installing:
===========
make install [DESTDIR=X]

Create a bundle on Mac:
Installation
============

To install this binary execute the following:

```bash
sudo make install
```

You can specify the destination dir with
```
DESTDIR=X
```


Packaging
=========

You can create a package to redistribute KeePassXR (zip, deb, rpm, dmg, etc..)
```
make package
```


Testing
=======

Run tests:
==========
make test [CTEST_OUTPUT_ON_FAILURE=1] [ARGS+=-jX] [ARGS+="-E testgui"]
You can perform test on the executable
```
make test
```

OS specific instructions:
=========================
https://www.keepassx.org/dev/projects/keepassx/wiki/Install_instructions
Common parameters:
```
CTEST_OUTPUT_ON_FAILURE=1
ARGS+=-jX
ARGS+="-E testgui"
```
48 changes: 9 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,54 +15,24 @@ KeePassHttp implementation has been forked from jdachtera's repository, which in
This is a rebuild from [denk-mal's keepasshttp](https://github.com/denk-mal/keepassx.git) that brings it forward to Qt5 and KeePassX v2.x.


#### Build Dependencies
### Installation

The following tools must exist within your PATH:
Right now KeePassXR does not have a precompiled executable or an installation package.<br/>
So you must install it from its source code.

* make
* cmake (>= 2.8.12)
* g++ (>= 4.7) or clang++ (>= 3.0)
**More detailed instructions are available in the INSTALL file or at the [Wiki page](https://github.com/keepassxreboot/keepassx/wiki/Install-Instruction-from-Source).**

The following libraries are required:
First you must download the KeePassXR source code as ZIP file or with Git.

* Qt 5 (>= 5.2): qtbase and qttools5
* libgcrypt (>= 1.6)
* zlib
* libmicrohttpd
* libxi, libxtst, qtx11extras (optional for auto-type on X11)

On Debian/Ubuntu you can install them with:

```bash
sudo apt-get install build-essential cmake libmicrohttpd-dev libxi-dev libxtst-dev qtbase5-dev libqt5x11extras5-dev qttools5-dev qttools5-dev-tools libgcrypt20-dev zlib1g-dev
Generally you can build and install KeePassXR with the following commands from a Terminal in the KeePassXR folder
```

On Fedora/RHEL/CentOS you can install them with:

```bash
sudo dnf install make automake gcc gcc-c++ cmake libmicrohttpd-devel libXi-devel libXtst-devel qt5-qtbase-devel qt5-qtx11extras qt5-qttools libgcrypt-devel zlib-devel
```

#### Build Steps

To compile from source:

```bash
mkdir build
cd build
cmake -DWITH_TESTS=OFF ..
make [-jX]
```

You will have the compiled KeePassX binary inside the `./build/src/` directory.

To install this binary execute the following:

```bash
cmake -DWITH_TESTS=OFF
make
sudo make install
```

More detailed instructions available in the INSTALL file.

### Clone Repository

Expand All @@ -80,10 +50,10 @@ To update the project from within the project's folder you can run the following
git pull
```


### Contributing

We're always looking for suggestions to improve our application. If you have a suggestion for improving an existing feature,
or would like to suggest a completely new feature for KeePassX Reboot, please use the [Issues](https://github.com/keepassxreboot/keepassx/issues) section or our [Google Groups](https://groups.google.com/forum/#!forum/keepassx-reboot) forum.

Please review the [CONTRIBUTING](.github/CONTRIBUTING.md) document for further information.

1 change: 1 addition & 0 deletions src/core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ void Config::init(const QString& fileName)
m_defaults.insert("security/clearclipboardtimeout", 10);
m_defaults.insert("security/lockdatabaseidle", false);
m_defaults.insert("security/lockdatabaseidlesec", 10);
m_defaults.insert("security/lockdatabaseminimize", false);
m_defaults.insert("security/passwordscleartext", false);
m_defaults.insert("security/autotypeask", true);
m_defaults.insert("GUI/Language", "system");
Expand Down
9 changes: 9 additions & 0 deletions src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,11 @@ void MainWindow::closeEvent(QCloseEvent* event)
{
event->ignore();
hide();

if (config()->get("security/lockdatabaseminimize").toBool()) {
m_ui->tabWidget->lockDatabases();
}

return;
}

Expand Down Expand Up @@ -685,6 +690,10 @@ void MainWindow::toggleWindow()
{
if ((QApplication::activeWindow() == this) && isVisible() && !isMinimized()) {
hide();

if (config()->get("security/lockdatabaseminimize").toBool()) {
m_ui->tabWidget->lockDatabases();
}
}
else {
ensurePolished();
Expand Down
6 changes: 2 additions & 4 deletions src/gui/SettingsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
#include "core/Config.h"
#include "core/Translator.h"

#include "http/OptionDialog.h"

#include "http/HttpSettings.h"

class SettingsWidget::ExtraPage
{
public:
Expand Down Expand Up @@ -143,6 +139,7 @@ void SettingsWidget::loadSettings()

m_secUi->lockDatabaseIdleCheckBox->setChecked(config()->get("security/lockdatabaseidle").toBool());
m_secUi->lockDatabaseIdleSpinBox->setValue(config()->get("security/lockdatabaseidlesec").toInt());
m_secUi->lockDatabaseMinimizeCheckBox->setChecked(config()->get("security/lockdatabaseminimize").toBool());

m_secUi->passwordCleartextCheckBox->setChecked(config()->get("security/passwordscleartext").toBool());

Expand Down Expand Up @@ -187,6 +184,7 @@ void SettingsWidget::saveSettings()

config()->set("security/lockdatabaseidle", m_secUi->lockDatabaseIdleCheckBox->isChecked());
config()->set("security/lockdatabaseidlesec", m_secUi->lockDatabaseIdleSpinBox->value());
config()->set("security/lockdatabaseminimize", m_secUi->lockDatabaseMinimizeCheckBox->isChecked());

config()->set("security/passwordscleartext", m_secUi->passwordCleartextCheckBox->isChecked());

Expand Down
Loading

0 comments on commit aa6994d

Please sign in to comment.