FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
abaddon/src/dialogs/token.cpp at master · uowuo/abaddon · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
uowuo
/
abaddon
Public
Notifications
You must be signed in to change notification settings
Fork
90
Star
2.2k
Code
Issues
92
Pull requests
18
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
abaddon
/
src
/
dialogs
/
token.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
45 lines (37 loc) · 1.26 KB
Breadcrumbs
abaddon
/
src
/
dialogs
/
token.cpp
Copy path
File metadata and controls
45 lines (37 loc) · 1.26 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#
include
"
token.hpp
"
std::string
trim
(
const
std::string &str) {
const
auto
first = str.
find_first_not_of
(
'
'
);
if
(first == std::string::npos)
return
str;
const
auto
last = str.
find_last_not_of
(
'
'
);
return
str.
substr
(first, last - first +
1
);
}
TokenDialog::TokenDialog
(Gtk::Window &parent)
: Gtk::Dialog(
"
Set Token
"
, parent,
true
)
, m_layout(Gtk::
ORIENTATION_VERTICAL
)
, m_ok(
"
OK
"
)
, m_cancel(
"
Cancel
"
)
, m_bbox(Gtk::
ORIENTATION_HORIZONTAL
) {
set_default_size
(
300
,
50
);
get_style_context
()->
add_class
(
"
app-window
"
);
get_style_context
()->
add_class
(
"
app-popup
"
);
m_ok.
signal_clicked
().
connect
([&]() {
m_token =
trim
(m_entry.
get_text
());
response
(Gtk::
RESPONSE_OK
);
});
m_cancel.
signal_clicked
().
connect
([&]() {
response
(Gtk::
RESPONSE_CANCEL
);
});
m_bbox.
pack_start
(m_ok, Gtk::
PACK_SHRINK
);
m_bbox.
pack_start
(m_cancel, Gtk::
PACK_SHRINK
);
m_bbox.
set_layout
(Gtk::
BUTTONBOX_END
);
m_entry.
set_input_purpose
(Gtk::
INPUT_PURPOSE_PASSWORD
);
m_entry.
set_visibility
(
false
);
m_entry.
set_hexpand
(
true
);
m_layout.
add
(m_entry);
m_layout.
add
(m_bbox);
get_content_area
()->
add
(m_layout);
show_all_children
();
}
std::string
TokenDialog::GetToken
() {
return
m_token;
}
Back
|
FazBrowse Home
|
New Git URL