Skip to content

Commit b77c784

Browse files
authored
Impoovement16 17 (#18)
* fix issues #16 and #17 and set equal width for labels: ticket cache and principal * fix issues #16 and #17 and set equal width for labels: ticket cache and principal * fix #16 and #17
1 parent effb1c0 commit b77c784

File tree

4 files changed

+108
-123
lines changed

4 files changed

+108
-123
lines changed

src/kinitdialog.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ bool KinitDialog::ldapServerIsEmpty() const { return lineEditLdapServer->text().
8484

8585
QString KinitDialog::ldapServerText() const { return lineEditLdapServer->text(); }
8686

87+
void KinitDialog::ldapServerSetText(const QString &text) { lineEditLdapServer->setText(text); }
88+
8789
KinitDialog::~KinitDialog() = default;
8890

8991
void KinitDialog::changeDetailsState(int state) {

src/kinitdialog.h

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ class KinitDialog : public QDialog, private Ui::KinitDialog {
6363

6464
QString ldapServerText() const;
6565

66+
void ldapServerSetText(const QString& text);
67+
6668
public slots:
6769
void changeDetailsState(int state);
6870
void changeRenewState(int state);

src/krb5ticketwatcher.cpp

+4-45
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
#include <QPushButton>
4242
#include <QSpinBox>
4343
#include <QSystemTrayIcon>
44-
// #include <QTextCodec>
4544
#include <QDir>
4645
#include <QList>
4746
#include <QSettings>
@@ -71,48 +70,6 @@
7170

7271
static int pw_exp;
7372

74-
static const unsigned char trayimage[] = {
75-
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x16,
76-
0x08, 0x06, 0x00, 0x00, 0x00, 0xc4, 0xb4, 0x6c, 0x3b, 0x00, 0x00, 0x03, 0x86, 0x49, 0x44, 0x41, 0x54, 0x38, 0x8d, 0xad, 0x94, 0xbd, 0x6f, 0x23,
77-
0x45, 0x18, 0x87, 0x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0x06, 0x70, 0x60, 0x73, 0x98, 0x3e,
100-
0x40, 0x8a, 0xbb, 0xf8, 0xca, 0xa7, 0xdf, 0xef, 0x93, 0x65, 0x29, 0xdb, 0xdb, 0xdb, 0x37, 0xad, 0xc8, 0xb3, 0x82, 0xac, 0x28, 0x90, 0xf9, 0x39,
101-
0xe6, 0xec, 0x47, 0x5c, 0x6a, 0x71, 0xd1, 0x14, 0x2b, 0x1c, 0x9e, 0x74, 0x38, 0x6f, 0x0d, 0x11, 0xde, 0x01, 0xbf, 0x06, 0x08, 0xf0, 0x6b, 0x78,
102-
0x9e, 0x40, 0x07, 0x3e, 0xc3, 0xe3, 0x21, 0x79, 0x96, 0x2d, 0x5a, 0x31, 0x57, 0x2c, 0x95, 0x44, 0x29, 0x85, 0x2b, 0x86, 0x94, 0xa5, 0x9d, 0x4d,
103-
0xa9, 0x22, 0x3c, 0x2f, 0xc2, 0xa9, 0x55, 0x5c, 0xd0, 0xc0, 0x55, 0xea, 0xa0, 0xd7, 0xc0, 0xf3, 0x11, 0x7e, 0x88, 0xa0, 0xc4, 0x1a, 0xc3, 0xfd,
104-
0xf6, 0x7d, 0x2a, 0x95, 0x70, 0xb9, 0xc7, 0xce, 0x38, 0x9c, 0x17, 0x62, 0xcb, 0x31, 0x41, 0x20, 0x31, 0xd6, 0xa2, 0x74, 0x80, 0xac, 0x54, 0x91,
105-
0xd5, 0x15, 0x64, 0x75, 0x15, 0xa2, 0x75, 0x08, 0xef, 0x80, 0x5e, 0xa3, 0xfb, 0xf5, 0xec, 0x61, 0xe2, 0xfb, 0x3d, 0x96, 0x85, 0x9a, 0x5f, 0x8e,
106-
0xde, 0xd1, 0x53, 0x9e, 0x9f, 0x0f, 0xb0, 0xea, 0x7d, 0xaa, 0x95, 0x1a, 0x36, 0x1f, 0x21, 0x4d, 0x15, 0x31, 0x89, 0x20, 0x0f, 0x90, 0x03, 0x0f,
107-
0x21, 0x7d, 0xf0, 0x4a, 0x8c, 0x3b, 0x05, 0x9a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x60, 0x82};
115-
11673
Ktw::Ktw(int &argc, char **argv, QWidget *parent, Qt::WindowFlags fl)
11774
: QWidget(parent, fl), tray(nullptr), trayMenu(nullptr), waitTimer(), translator(), _context(), _principal(nullptr), tgtEndtime(0) {
11875
if (argc >= 3) {
@@ -280,6 +237,7 @@ void Ktw::createTrayMenu() {
280237
void Ktw::forceRenewCredential() {
281238
qDebug("forceRenewCredential called");
282239
initWorkflow(1);
240+
Q_EMIT refreshButton->click();
283241
}
284242

285243
void Ktw::destroyCredential() {
@@ -443,6 +401,7 @@ void Ktw::kinit() {
443401
const QString user = getUserName();
444402
QString principalKey = QString("%1_principal").arg(user);
445403
QString pwdKey = QString("%1_pwd").arg(user);
404+
loadOptions();
446405
do {
447406
ok = false;
448407
QString principal;
@@ -487,6 +446,8 @@ void Ktw::kinit() {
487446
dlg->renewCheckBoxSetChecked(false);
488447
}
489448

449+
dlg->ldapServerSetText(_options.ldapServer);
450+
490451
int ret = dlg->exec();
491452
if (ret == QDialog::Rejected) {
492453
qDebug("rejected");
@@ -528,8 +489,6 @@ void Ktw::kinit() {
528489
if (!dlg->ldapServerIsEmpty()) {
529490
_options.ldapServer = dlg->ldapServerText();
530491
}
531-
} else {
532-
loadOptions();
533492
}
534493

535494
setOptions(credsOpts);

src/mainwidget.ui

+100-78
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
<widget class="QGroupBox" name="groupBoxCredCache">
8282
<property name="font">
8383
<font>
84+
<weight>75</weight>
8485
<bold>true</bold>
8586
</font>
8687
</property>
@@ -91,84 +92,91 @@
9192
<item row="0" column="0">
9293
<layout class="QHBoxLayout" name="horizontalLayout">
9394
<item>
94-
<widget class="QLabel" name="commonLabel">
95-
<property name="minimumSize">
96-
<size>
97-
<width>120</width>
98-
<height>0</height>
99-
</size>
100-
</property>
101-
<property name="font">
102-
<font>
103-
<bold>true</bold>
104-
</font>
105-
</property>
106-
<property name="text">
107-
<string>TextLabel</string>
108-
</property>
109-
<property name="wordWrap">
110-
<bool>false</bool>
111-
</property>
112-
</widget>
113-
</item>
114-
<item>
115-
<widget class="QLabel" name="labelCacheV">
116-
<property name="font">
117-
<font>
118-
<bold>false</bold>
119-
</font>
120-
</property>
121-
<property name="text">
122-
<string>TextLabel</string>
123-
</property>
124-
</widget>
125-
</item>
126-
<item>
127-
<spacer name="horizontalSpacer">
128-
<property name="orientation">
129-
<enum>Qt::Horizontal</enum>
130-
</property>
131-
<property name="sizeHint" stdset="0">
132-
<size>
133-
<width>40</width>
134-
<height>20</height>
135-
</size>
136-
</property>
137-
</spacer>
138-
</item>
139-
</layout>
140-
</item>
141-
<item row="1" column="0">
142-
<layout class="QHBoxLayout" name="horizontalLayout_2">
143-
<item>
144-
<widget class="QLabel" name="labelPrincipal">
145-
<property name="minimumSize">
146-
<size>
147-
<width>120</width>
148-
<height>0</height>
149-
</size>
150-
</property>
151-
<property name="font">
152-
<font>
153-
<bold>true</bold>
154-
</font>
155-
</property>
156-
<property name="text">
157-
<string>TextLabel</string>
158-
</property>
159-
</widget>
160-
</item>
161-
<item>
162-
<widget class="QLabel" name="labelPrincipalV">
163-
<property name="font">
164-
<font>
165-
<bold>false</bold>
166-
</font>
167-
</property>
168-
<property name="text">
169-
<string>TextLabel</string>
170-
</property>
171-
</widget>
95+
<layout class="QVBoxLayout" name="verticalLayout">
96+
<item>
97+
<widget class="QLabel" name="commonLabel">
98+
<property name="sizePolicy">
99+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
100+
<horstretch>0</horstretch>
101+
<verstretch>0</verstretch>
102+
</sizepolicy>
103+
</property>
104+
<property name="minimumSize">
105+
<size>
106+
<width>120</width>
107+
<height>0</height>
108+
</size>
109+
</property>
110+
<property name="font">
111+
<font>
112+
<weight>75</weight>
113+
<bold>true</bold>
114+
</font>
115+
</property>
116+
<property name="text">
117+
<string>TextLabel</string>
118+
</property>
119+
<property name="wordWrap">
120+
<bool>false</bool>
121+
</property>
122+
</widget>
123+
</item>
124+
<item>
125+
<widget class="QLabel" name="labelPrincipal">
126+
<property name="sizePolicy">
127+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
128+
<horstretch>0</horstretch>
129+
<verstretch>0</verstretch>
130+
</sizepolicy>
131+
</property>
132+
<property name="minimumSize">
133+
<size>
134+
<width>120</width>
135+
<height>0</height>
136+
</size>
137+
</property>
138+
<property name="font">
139+
<font>
140+
<weight>75</weight>
141+
<bold>true</bold>
142+
</font>
143+
</property>
144+
<property name="text">
145+
<string>TextLabel</string>
146+
</property>
147+
</widget>
148+
</item>
149+
</layout>
150+
</item>
151+
<item>
152+
<layout class="QVBoxLayout" name="verticalLayout_2">
153+
<item>
154+
<widget class="QLabel" name="labelCacheV">
155+
<property name="font">
156+
<font>
157+
<weight>50</weight>
158+
<bold>false</bold>
159+
</font>
160+
</property>
161+
<property name="text">
162+
<string>TextLabel</string>
163+
</property>
164+
</widget>
165+
</item>
166+
<item>
167+
<widget class="QLabel" name="labelPrincipalV">
168+
<property name="font">
169+
<font>
170+
<weight>50</weight>
171+
<bold>false</bold>
172+
</font>
173+
</property>
174+
<property name="text">
175+
<string>TextLabel</string>
176+
</property>
177+
</widget>
178+
</item>
179+
</layout>
172180
</item>
173181
<item>
174182
<spacer name="horizontalSpacer_2">
@@ -246,6 +254,7 @@
246254
</property>
247255
<property name="font">
248256
<font>
257+
<weight>75</weight>
249258
<bold>true</bold>
250259
</font>
251260
</property>
@@ -290,6 +299,7 @@
290299
</property>
291300
<property name="font">
292301
<font>
302+
<weight>75</weight>
293303
<bold>true</bold>
294304
</font>
295305
</property>
@@ -334,6 +344,7 @@
334344
</property>
335345
<property name="font">
336346
<font>
347+
<weight>75</weight>
337348
<bold>true</bold>
338349
</font>
339350
</property>
@@ -378,6 +389,7 @@
378389
</property>
379390
<property name="font">
380391
<font>
392+
<weight>75</weight>
381393
<bold>true</bold>
382394
</font>
383395
</property>
@@ -422,6 +434,7 @@
422434
</property>
423435
<property name="font">
424436
<font>
437+
<weight>75</weight>
425438
<bold>true</bold>
426439
</font>
427440
</property>
@@ -466,6 +479,7 @@
466479
</property>
467480
<property name="font">
468481
<font>
482+
<weight>75</weight>
469483
<bold>true</bold>
470484
</font>
471485
</property>
@@ -510,6 +524,7 @@
510524
</property>
511525
<property name="font">
512526
<font>
527+
<weight>75</weight>
513528
<bold>true</bold>
514529
</font>
515530
</property>
@@ -554,6 +569,7 @@
554569
</property>
555570
<property name="font">
556571
<font>
572+
<weight>75</weight>
557573
<bold>true</bold>
558574
</font>
559575
</property>
@@ -598,6 +614,7 @@
598614
</property>
599615
<property name="font">
600616
<font>
617+
<weight>75</weight>
601618
<bold>true</bold>
602619
</font>
603620
</property>
@@ -642,6 +659,7 @@
642659
</property>
643660
<property name="font">
644661
<font>
662+
<weight>75</weight>
645663
<bold>true</bold>
646664
</font>
647665
</property>
@@ -686,6 +704,7 @@
686704
</property>
687705
<property name="font">
688706
<font>
707+
<weight>75</weight>
689708
<bold>true</bold>
690709
</font>
691710
</property>
@@ -730,6 +749,7 @@
730749
</property>
731750
<property name="font">
732751
<font>
752+
<weight>75</weight>
733753
<bold>true</bold>
734754
</font>
735755
</property>
@@ -774,6 +794,7 @@
774794
</property>
775795
<property name="font">
776796
<font>
797+
<weight>75</weight>
777798
<bold>true</bold>
778799
</font>
779800
</property>
@@ -818,6 +839,7 @@
818839
</property>
819840
<property name="font">
820841
<font>
842+
<weight>75</weight>
821843
<bold>true</bold>
822844
</font>
823845
</property>

0 commit comments

Comments
 (0)