-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add feature to handle field references, resolves #75 #370
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* Copyright (C) 2012 Felix Geyer <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 2 or (at your option) | ||
* version 3 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "CloneDialog.h" | ||
#include "ui_CloneDialog.h" | ||
|
||
#include "config-keepassx.h" | ||
#include "version.h" | ||
#include "core/Database.h" | ||
#include "core/Entry.h" | ||
#include "core/FilePath.h" | ||
#include "crypto/Crypto.h" | ||
#include "gui/DatabaseWidget.h" | ||
|
||
CloneDialog::CloneDialog(DatabaseWidget* parent, Database* db, Entry* entry) | ||
: QDialog(parent) | ||
, m_ui(new Ui::CloneDialog()) | ||
{ | ||
m_db = db; | ||
m_entry = entry; | ||
m_parent = parent; | ||
|
||
m_ui->setupUi(this); | ||
|
||
setAttribute(Qt::WA_DeleteOnClose); | ||
|
||
connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(close())); | ||
connect(m_ui->buttonBox, SIGNAL(accepted()), SLOT(cloneEntry())); | ||
} | ||
|
||
void CloneDialog::cloneEntry() | ||
{ | ||
Entry::CloneFlags flags = Entry::CloneNewUuid | Entry::CloneResetTimeInfo; | ||
|
||
if (m_ui->titleClone->isChecked()) { | ||
flags |= Entry::CloneRenameTitle; | ||
} | ||
|
||
if (m_ui->referencesClone->isChecked()) { | ||
flags |= Entry::CloneUserAsRef; | ||
flags |= Entry::ClonePassAsRef; | ||
} | ||
|
||
if (m_ui->historyClone->isChecked()) { | ||
flags |= Entry::CloneIncludeHistory; | ||
} | ||
|
||
Entry* entry = m_entry->clone(flags); | ||
entry->setGroup(m_entry->group()); | ||
|
||
emit m_parent->refreshSearch(); | ||
close(); | ||
} | ||
|
||
CloneDialog::~CloneDialog() | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright (C) 2012 Felix Geyer <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 2 or (at your option) | ||
* version 3 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef KEEPASSX_CLONEDIALOG_H | ||
#define KEEPASSX_CLONEDIALOG_H | ||
|
||
#include <QDialog> | ||
#include <QScopedPointer> | ||
#include "core/Entry.h" | ||
#include "core/Database.h" | ||
#include "gui/DatabaseWidget.h" | ||
|
||
namespace Ui { | ||
class CloneDialog; | ||
} | ||
|
||
class CloneDialog : public QDialog | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit CloneDialog(DatabaseWidget* parent = nullptr, Database* db = nullptr, Entry* entry = nullptr); | ||
~CloneDialog(); | ||
|
||
private: | ||
QScopedPointer<Ui::CloneDialog> m_ui; | ||
|
||
private Q_SLOTS: | ||
void cloneEntry(); | ||
|
||
protected: | ||
Database* m_db; | ||
Entry* m_entry; | ||
DatabaseWidget* m_parent; | ||
}; | ||
|
||
#endif // KEEPASSX_CLONEDIALOG_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>CloneDialog</class> | ||
<widget class="QDialog" name="CloneDialog"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>338</width> | ||
<height>120</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Clone Options</string> | ||
</property> | ||
<widget class="QWidget" name="formLayoutWidget"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>12</x> | ||
<y>12</y> | ||
<width>323</width> | ||
<height>62</height> | ||
</rect> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout_2"> | ||
<item> | ||
<widget class="QCheckBox" name="titleClone"> | ||
<property name="maximumSize"> | ||
<size> | ||
<width>170</width> | ||
<height>16777215</height> | ||
</size> | ||
</property> | ||
<property name="text"> | ||
<string>Append ' - Copy' to title</string> | ||
</property> | ||
<property name="checked"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QCheckBox" name="referencesClone"> | ||
<property name="text"> | ||
<string>Replace username and password with references</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QCheckBox" name="historyClone"> | ||
<property name="text"> | ||
<string>Copy history</string> | ||
</property> | ||
<property name="checked"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<widget class="QDialogButtonBox" name="buttonBox"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>160</x> | ||
<y>90</y> | ||
<width>164</width> | ||
<height>32</height> | ||
</rect> | ||
</property> | ||
<property name="standardButtons"> | ||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> | ||
</property> | ||
</widget> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem:
toHex()
seems to give upper case UUID. If the UUID of the source entry is lowercase,resolvePlaceholder
will fail.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am i misinterpreting that, or do u simply uppercase the
username
at line 501? Just remove it? Or is the problem that different locations have different behaviours?EDIT:// I mean,
username.toUpper()
must do something like that..^^