10#define UI_MAINWINDOW_H
12#include <QtCore/QVariant>
13#include <QtGui/QAction>
15#include <QtWidgets/QApplication>
16#include <QtWidgets/QComboBox>
17#include <QtWidgets/QFrame>
18#include <QtWidgets/QGridLayout>
19#include <QtWidgets/QHBoxLayout>
20#include <QtWidgets/QHeaderView>
21#include <QtWidgets/QLabel>
22#include <QtWidgets/QLineEdit>
23#include <QtWidgets/QMainWindow>
24#include <QtWidgets/QSpacerItem>
25#include <QtWidgets/QStatusBar>
26#include <QtWidgets/QTextBrowser>
27#include <QtWidgets/QToolBar>
28#include <QtWidgets/QToolButton>
29#include <QtWidgets/QTreeWidget>
30#include <QtWidgets/QVBoxLayout>
31#include <QtWidgets/QWidget>
32#include <deselectabletreeview.h>
39 QAction *actionAddPassword;
40 QAction *actionAddFolder;
42 QAction *actionDelete;
45 QAction *actionUpdate;
47 QAction *actionConfig;
48 QWidget *centralWidget;
49 QGridLayout *gridLayout_2;
51 QHBoxLayout *horizontalLayout_2;
52 QHBoxLayout *horizontalLayout_3;
53 QVBoxLayout *verticalLayout;
54 QWidget *profileWidget;
55 QHBoxLayout *horizontalLayout;
57 QComboBox *profileBox;
58 QHBoxLayout *searchLayout;
60 QToolButton *grepButton;
61 QToolButton *grepCaseButton;
63 QTreeWidget *grepResultsList;
64 QVBoxLayout *verticalLayoutPassword;
66 QSpacerItem *verticalSpacer_2;
67 QGridLayout *gridLayout;
68 QTextBrowser *textBrowser;
69 QStatusBar *statusBar;
78 icon.addFile(QString::fromUtf8(
":/artwork/icon.png"), QSize(), QIcon::Mode::Normal, QIcon::State::Off);
81 actionAddPassword->setObjectName(
"actionAddPassword");
83 actionAddFolder->setObjectName(
"actionAddFolder");
85 actionEdit->setObjectName(
"actionEdit");
87 actionDelete->setObjectName(
"actionDelete");
89 actionOtp->setObjectName(
"actionOtp");
91 actionPush->setObjectName(
"actionPush");
93 actionUpdate->setObjectName(
"actionUpdate");
95 actionUsers->setObjectName(
"actionUsers");
97 actionConfig->setObjectName(
"actionConfig");
99 centralWidget->setObjectName(
"centralWidget");
100 gridLayout_2 =
new QGridLayout(centralWidget);
101 gridLayout_2->setSpacing(6);
102 gridLayout_2->setContentsMargins(11, 11, 11, 11);
103 gridLayout_2->setObjectName(
"gridLayout_2");
104 frame =
new QFrame(centralWidget);
105 frame->setObjectName(
"frame");
106 QSizePolicy sizePolicy(QSizePolicy::Policy::Preferred, QSizePolicy::Policy::Fixed);
107 sizePolicy.setHorizontalStretch(0);
108 sizePolicy.setVerticalStretch(0);
109 sizePolicy.setHeightForWidth(frame->sizePolicy().hasHeightForWidth());
110 frame->setSizePolicy(sizePolicy);
111 horizontalLayout_2 =
new QHBoxLayout(frame);
112 horizontalLayout_2->setSpacing(6);
113 horizontalLayout_2->setContentsMargins(11, 11, 11, 11);
114 horizontalLayout_2->setObjectName(
"horizontalLayout_2");
115 horizontalLayout_2->setContentsMargins(0, 0, 0, 0);
117 gridLayout_2->addWidget(frame, 0, 0, 2, 2);
119 horizontalLayout_3 =
new QHBoxLayout();
120 horizontalLayout_3->setSpacing(6);
121 horizontalLayout_3->setObjectName(
"horizontalLayout_3");
122 verticalLayout =
new QVBoxLayout();
123 verticalLayout->setSpacing(6);
124 verticalLayout->setObjectName(
"verticalLayout");
125 profileWidget =
new QWidget(centralWidget);
126 profileWidget->setObjectName(
"profileWidget");
127 horizontalLayout =
new QHBoxLayout(profileWidget);
128 horizontalLayout->setSpacing(6);
129 horizontalLayout->setContentsMargins(11, 11, 11, 11);
130 horizontalLayout->setObjectName(
"horizontalLayout");
131 horizontalLayout->setContentsMargins(0, 0, 0, 0);
132 label =
new QLabel(profileWidget);
133 label->setObjectName(
"label");
135 horizontalLayout->addWidget(label);
137 profileBox =
new QComboBox(profileWidget);
138 profileBox->setObjectName(
"profileBox");
139 QSizePolicy sizePolicy1(QSizePolicy::Policy::Minimum, QSizePolicy::Policy::Minimum);
140 sizePolicy1.setHorizontalStretch(0);
141 sizePolicy1.setVerticalStretch(0);
142 sizePolicy1.setHeightForWidth(profileBox->sizePolicy().hasHeightForWidth());
143 profileBox->setSizePolicy(sizePolicy1);
144 profileBox->setMinimumSize(QSize(100, 26));
145 profileBox->setMaximumSize(QSize(100000, 16777215));
147 horizontalLayout->addWidget(profileBox);
150 verticalLayout->addWidget(profileWidget);
152 searchLayout =
new QHBoxLayout();
153 searchLayout->setSpacing(2);
154 searchLayout->setObjectName(
"searchLayout");
155 lineEdit =
new QLineEdit(centralWidget);
156 lineEdit->setObjectName(
"lineEdit");
157 lineEdit->setMinimumSize(QSize(0, 26));
158 lineEdit->setFocusPolicy(Qt::StrongFocus);
160 searchLayout->addWidget(lineEdit);
162 grepButton =
new QToolButton(centralWidget);
163 grepButton->setObjectName(
"grepButton");
164 grepButton->setCheckable(
true);
166 searchLayout->addWidget(grepButton);
168 grepCaseButton =
new QToolButton(centralWidget);
169 grepCaseButton->setObjectName(
"grepCaseButton");
170 grepCaseButton->setCheckable(
true);
172 searchLayout->addWidget(grepCaseButton);
175 verticalLayout->addLayout(searchLayout);
178 treeView->setObjectName(
"treeView");
179 QSizePolicy sizePolicy2(QSizePolicy::Policy::Minimum, QSizePolicy::Policy::MinimumExpanding);
180 sizePolicy2.setHorizontalStretch(0);
181 sizePolicy2.setVerticalStretch(0);
182 sizePolicy2.setHeightForWidth(treeView->sizePolicy().hasHeightForWidth());
183 treeView->setSizePolicy(sizePolicy2);
184 treeView->setAcceptDrops(
true);
185 treeView->setSizeAdjustPolicy(QAbstractScrollArea::AdjustIgnored);
186 treeView->setDragEnabled(
true);
187 treeView->setDragDropMode(QAbstractItemView::InternalMove);
188 treeView->setSortingEnabled(
true);
189 treeView->setAnimated(
true);
190 treeView->header()->setStretchLastSection(
false);
192 verticalLayout->addWidget(treeView);
194 grepResultsList =
new QTreeWidget(centralWidget);
195 grepResultsList->setObjectName(
"grepResultsList");
196 sizePolicy2.setHeightForWidth(grepResultsList->sizePolicy().hasHeightForWidth());
197 grepResultsList->setSizePolicy(sizePolicy2);
198 grepResultsList->setVisible(
false);
199 grepResultsList->setHeaderHidden(
true);
201 verticalLayout->addWidget(grepResultsList);
204 horizontalLayout_3->addLayout(verticalLayout);
206 verticalLayoutPassword =
new QVBoxLayout();
207 verticalLayoutPassword->setSpacing(0);
208 verticalLayoutPassword->setObjectName(
"verticalLayoutPassword");
209 verticalLayoutPassword->setContentsMargins(-1, 7, -1, -1);
210 passwordName =
new QLabel(centralWidget);
211 passwordName->setObjectName(
"passwordName");
212 QSizePolicy sizePolicy3(QSizePolicy::Policy::Expanding, QSizePolicy::Policy::Fixed);
213 sizePolicy3.setHorizontalStretch(0);
214 sizePolicy3.setVerticalStretch(0);
215 sizePolicy3.setHeightForWidth(passwordName->sizePolicy().hasHeightForWidth());
216 passwordName->setSizePolicy(sizePolicy3);
217 passwordName->setMinimumSize(QSize(0, 20));
218 passwordName->setMaximumSize(QSize(10000000, 30));
220 font.setPointSize(14);
222 font.setItalic(
false);
223 font.setUnderline(
false);
224 font.setKerning(
true);
225 passwordName->setFont(font);
226 passwordName->setFrameShape(QFrame::NoFrame);
227 passwordName->setFrameShadow(QFrame::Plain);
228 passwordName->setScaledContents(
false);
229 passwordName->setTextInteractionFlags(Qt::TextInteractionFlag::LinksAccessibleByMouse|Qt::TextInteractionFlag::TextSelectableByMouse);
231 verticalLayoutPassword->addWidget(passwordName);
233 verticalSpacer_2 =
new QSpacerItem(20, 5, QSizePolicy::Policy::Minimum, QSizePolicy::Policy::Fixed);
235 verticalLayoutPassword->addItem(verticalSpacer_2);
237 gridLayout =
new QGridLayout();
238 gridLayout->setSpacing(6);
239 gridLayout->setObjectName(
"gridLayout");
241 verticalLayoutPassword->addLayout(gridLayout);
243 textBrowser =
new QTextBrowser(centralWidget);
244 textBrowser->setObjectName(
"textBrowser");
245 QSizePolicy sizePolicy4(QSizePolicy::Policy::Expanding, QSizePolicy::Policy::Expanding);
246 sizePolicy4.setHorizontalStretch(0);
247 sizePolicy4.setVerticalStretch(0);
248 sizePolicy4.setHeightForWidth(textBrowser->sizePolicy().hasHeightForWidth());
249 textBrowser->setSizePolicy(sizePolicy4);
250 textBrowser->setMinimumSize(QSize(0, 20));
251 textBrowser->setAutoFillBackground(
false);
252 textBrowser->setStyleSheet(QString::fromUtf8(
"background: palette(base)"));
253 textBrowser->setFrameShape(QFrame::NoFrame);
254 textBrowser->setFrameShadow(QFrame::Plain);
255 textBrowser->setLineWidth(0);
256 textBrowser->setAcceptRichText(
true);
257 textBrowser->setOpenExternalLinks(
true);
259 verticalLayoutPassword->addWidget(textBrowser);
262 horizontalLayout_3->addLayout(verticalLayoutPassword);
265 gridLayout_2->addLayout(horizontalLayout_3, 1, 1, 1, 1);
269 statusBar->setObjectName(
"statusBar");
272 toolBar->setObjectName(
"toolBar");
273 toolBar->setContextMenuPolicy(Qt::PreventContextMenu);
274 toolBar->setAcceptDrops(
false);
275 toolBar->setMovable(
false);
276 toolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
277 MainWindow->addToolBar(Qt::ToolBarArea::TopToolBarArea, toolBar);
278#if QT_CONFIG(shortcut)
279 label->setBuddy(profileBox);
281 QWidget::setTabOrder(lineEdit, grepButton);
282 QWidget::setTabOrder(grepButton, grepCaseButton);
283 QWidget::setTabOrder(grepCaseButton, treeView);
284 QWidget::setTabOrder(treeView, grepResultsList);
285 QWidget::setTabOrder(grepResultsList, textBrowser);
287 toolBar->addAction(actionAddPassword);
288 toolBar->addAction(actionAddFolder);
289 toolBar->addSeparator();
290 toolBar->addAction(actionEdit);
291 toolBar->addAction(actionDelete);
292 toolBar->addAction(actionOtp);
293 toolBar->addSeparator();
294 toolBar->addAction(actionPush);
295 toolBar->addAction(actionUpdate);
296 toolBar->addSeparator();
297 toolBar->addAction(actionUsers);
298 toolBar->addAction(actionConfig);
307 MainWindow->setWindowTitle(QCoreApplication::translate(
"MainWindow",
"QtPass",
nullptr));
308 actionAddPassword->setText(QCoreApplication::translate(
"MainWindow",
"Add password",
nullptr));
309#if QT_CONFIG(tooltip)
310 actionAddPassword->setToolTip(QCoreApplication::translate(
"MainWindow",
"Add password",
nullptr));
312#if QT_CONFIG(shortcut)
313 actionAddPassword->setShortcut(QCoreApplication::translate(
"MainWindow",
"Ctrl+N",
nullptr));
315 actionAddFolder->setText(QCoreApplication::translate(
"MainWindow",
"Add folder",
nullptr));
316#if QT_CONFIG(tooltip)
317 actionAddFolder->setToolTip(QCoreApplication::translate(
"MainWindow",
"Add folder",
nullptr));
319 actionEdit->setText(QCoreApplication::translate(
"MainWindow",
"Edit",
nullptr));
320#if QT_CONFIG(tooltip)
321 actionEdit->setToolTip(QCoreApplication::translate(
"MainWindow",
"Edit",
nullptr));
323 actionDelete->setText(QCoreApplication::translate(
"MainWindow",
"Delete",
nullptr));
324#if QT_CONFIG(tooltip)
325 actionDelete->setToolTip(QCoreApplication::translate(
"MainWindow",
"Delete",
nullptr));
327 actionOtp->setText(QCoreApplication::translate(
"MainWindow",
"OTP",
nullptr));
328#if QT_CONFIG(tooltip)
329 actionOtp->setToolTip(QCoreApplication::translate(
"MainWindow",
"Generate OTP and copy to clipboard",
nullptr));
331#if QT_CONFIG(shortcut)
332 actionOtp->setShortcut(QCoreApplication::translate(
"MainWindow",
"Ctrl+G",
nullptr));
334 actionPush->setText(QCoreApplication::translate(
"MainWindow",
"Push",
nullptr));
335#if QT_CONFIG(tooltip)
336 actionPush->setToolTip(QCoreApplication::translate(
"MainWindow",
"Git push",
nullptr));
338 actionUpdate->setText(QCoreApplication::translate(
"MainWindow",
"Update",
nullptr));
339#if QT_CONFIG(tooltip)
340 actionUpdate->setToolTip(QCoreApplication::translate(
"MainWindow",
"Git pull",
nullptr));
342 actionUsers->setText(QCoreApplication::translate(
"MainWindow",
"Users",
nullptr));
343#if QT_CONFIG(tooltip)
344 actionUsers->setToolTip(QCoreApplication::translate(
"MainWindow",
"Manage who can read password in folder",
nullptr));
346 actionConfig->setText(QCoreApplication::translate(
"MainWindow",
"Config",
nullptr));
347#if QT_CONFIG(tooltip)
348 actionConfig->setToolTip(QCoreApplication::translate(
"MainWindow",
"Configuration",
nullptr));
350 label->setText(QCoreApplication::translate(
"MainWindow",
"Select profile",
nullptr));
351 lineEdit->setText(QString());
352 lineEdit->setPlaceholderText(QCoreApplication::translate(
"MainWindow",
"Search Password",
nullptr));
353#if QT_CONFIG(tooltip)
354 grepButton->setToolTip(QCoreApplication::translate(
"MainWindow",
"Search inside password content (pass grep)",
nullptr));
356 grepButton->setText(QCoreApplication::translate(
"MainWindow",
"\342\214\225",
nullptr));
357#if QT_CONFIG(accessibility)
358 grepButton->setAccessibleName(QCoreApplication::translate(
"MainWindow",
"Content search toggle",
nullptr));
360#if QT_CONFIG(accessibility)
361 grepButton->setAccessibleDescription(QCoreApplication::translate(
"MainWindow",
"Toggle content search mode to search inside password files",
nullptr));
363#if QT_CONFIG(tooltip)
364 grepCaseButton->setToolTip(QCoreApplication::translate(
"MainWindow",
"Case-insensitive search",
nullptr));
366 grepCaseButton->setText(QCoreApplication::translate(
"MainWindow",
"Aa",
nullptr));
367#if QT_CONFIG(accessibility)
368 grepCaseButton->setAccessibleName(QCoreApplication::translate(
"MainWindow",
"Case-insensitive toggle",
nullptr));
370#if QT_CONFIG(accessibility)
371 grepCaseButton->setAccessibleDescription(QCoreApplication::translate(
"MainWindow",
"Toggle case-insensitive content search",
nullptr));
373 QTreeWidgetItem *___qtreewidgetitem = grepResultsList->headerItem();
374 ___qtreewidgetitem->setText(0, QCoreApplication::translate(
"MainWindow",
"Results",
nullptr));
375 passwordName->setText(QCoreApplication::translate(
"MainWindow",
"Welcome to QtPass",
nullptr));
376 textBrowser->setHtml(QCoreApplication::translate(
"MainWindow",
"<p>QtPass is a GUI for <a href=\"https://www.passwordstore.org/\">pass</a>, the standard unix password manager.</p>\n"
377"<p>Please report any <a href=\"https://github.com/IJHack/qtpass/issues\">issues</a> you might have with this software.</p>\n"
378"<p><a href=\"https://qtpass.org/\">Documentation</a></p>\n"
379"<p><a href=\"https://github.com/IJHack/qtpass\">SourceCode</a></p>",
nullptr));
380 toolBar->setWindowTitle(QString());
Main application window orchestrating UI, user interactions, and external process handlers.