Skip to content

Commit

Permalink
Initial design-like interface
Browse files Browse the repository at this point in the history
  • Loading branch information
tezeb committed Nov 21, 2016
1 parent ab4a3b5 commit e15c93f
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 1 deletion.
24 changes: 24 additions & 0 deletions imitatepass.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef IMITATEPASS_H
#define IMITATEPASS_H

#include "pass.h"

class ImitatePass : public Pass
{

bool removeDir(const QString &dirName);
public:
ImitatePass();
virtual ~ImitatePass() {}
virtual void GitInit() override;
virtual void GitPull() override;
virtual void GitPush() override;
virtual QProcess::ExitStatus Show(QString file, bool block=false) override;
virtual void Insert(QString file, QString value, bool overwrite=false) override;
virtual void Remove(QString file, bool isDir = false) override;
virtual void Init(QString path, const QList<UserInfo> &list) override;

void reencryptPath(QString dir);
};

#endif // IMITATEPASS_H
29 changes: 29 additions & 0 deletions pass.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#ifndef PASS_H
#define PASS_H

#include <QString>
#include <QList>
#include <QProcess>
#include <QQueue>
// TODO(bezet): extract UserInfo somewhere
#include "usersdialog.h"
#include "enums.h"


class Pass
{
public:
Pass();
virtual ~Pass() {}
virtual void GitInit() = 0;
virtual void GitPull() = 0;
virtual void GitPush() = 0;
virtual QProcess::ExitStatus Show(QString file, bool block=false) = 0;
virtual void Insert(QString file, QString value, bool force) = 0;
virtual void Remove(QString file, bool isDir) = 0;
virtual void Init(QString path, const QList<UserInfo> &users) = 0;
virtual QString Generate(int length, const QString& charset);

};

#endif // PASS_H
5 changes: 4 additions & 1 deletion qtpass.pro
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ HEADERS += mainwindow.h \
qpushbuttonwithclipboard.h \
qtpasssettings.h \
enums.h \
settingsconstants.h
settingsconstants.h \
pass.h \
realpass.h \
imitatepass.h

FORMS += mainwindow.ui \
configdialog.ui \
Expand Down
22 changes: 22 additions & 0 deletions realpass.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef REALPASS_H
#define REALPASS_H

#include "pass.h"

class RealPass : public Pass
{
private:
void executePass(QString args, QString input=QString());
public:
RealPass();
virtual ~RealPass() {}
virtual void GitInit() override;
virtual void GitPull() override;
virtual void GitPush() override;
virtual QProcess::ExitStatus Show(QString file, bool block=false) override;
virtual void Insert(QString file, QString value, bool overwrite=false) override;
virtual void Remove(QString file, bool isDir = false) override;
virtual void Init(QString path, const QList<UserInfo> &users) override;
};

#endif // REALPASS_H

0 comments on commit e15c93f

Please sign in to comment.