summaryrefslogtreecommitdiffstats
path: root/mainwindow.h
diff options
context:
space:
mode:
authorJonathan Hanks <brouwer@annejan.com>2015-11-20 20:15:41 -0800
committerJonathan Hanks <jonathan.hanks@ligo.org>2015-11-20 21:11:41 -0800
commit52b0477e7dcbc88a03436309ba4b0c250db221c3 (patch)
tree69f013dfb89721d33a1d77cb18442fd6205e95ea /mainwindow.h
parentb2f951d1469baba0af881b06978b44d690fb95d8 (diff)
Modified the clipboard logic to allow for on-demand copy to clipboard.
Changed the clipboard config entry to be a combobox instead of a checkbox. It has 3 states: Never copy to the clipboard Always copy to the clipboard On-demand copy to the clipboard Added a 'Password' button to the main window which copies the password to the clipboard when pressed. The button is disabled when there is no password loaded or passwords are set to never copy to the clipboard. Added a context menu entry to the text browser to copy the password to the clipboard. Moved some of the clipboard code around to make it more flexible. Clippedpass is always set when the password could be copied.
Diffstat (limited to 'mainwindow.h')
-rw-r--r--mainwindow.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/mainwindow.h b/mainwindow.h
index e63d9a41..33e107d0 100644
--- a/mainwindow.h
+++ b/mainwindow.h
@@ -35,6 +35,9 @@ class MainWindow : public QMainWindow
enum actionType { GPG, GIT, EDIT, DELETE, GPG_INTERNAL, PWGEN };
public:
+
+ enum clipBoardType { CLIPBOARD_NEVER=0, CLIPBOARD_ALWAYS=1, CLIPBOARD_ON_DEMAND=2 };
+
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void setPassExecutable(QString);
@@ -73,10 +76,13 @@ private slots:
void on_usersButton_clicked();
void messageAvailable(QString message);
void on_profileBox_currentIndexChanged(QString);
+ void on_copyPasswordButton_clicked();
void showContextMenu(const QPoint& pos);
+ void showBrowserContextMenu(const QPoint& pos);
void addFolder();
void editPassword();
void focusInput();
+ void copyPasswordToClipboard();
private:
QApplication *QtPass;
@@ -87,7 +93,7 @@ private:
QScopedPointer<QItemSelectionModel> selectionModel;
QScopedPointer<QProcess> process;
bool usePass;
- bool useClipboard;
+ clipBoardType useClipboard;
bool useAutoclear;
bool useAutoclearPanel;
bool hidePassword;
@@ -155,6 +161,8 @@ private:
bool removeDir(const QString & dirName);
void waitFor(int);
void clearTemplateWidgets();
+ void setClippedPassword(const QString & pass);
+ const QString &getClippedPassword();
};
#endif // MAINWINDOW_H