author | ulf69 <ulf69> | 2004-09-15 22:40:33 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-09-15 22:40:33 (UTC) |
commit | 56450c0322c2335a59ae8d8796e41397cdb09329 (patch) (unidiff) | |
tree | f2b331be957fc022fe7110671f7434755f21eca3 | |
parent | 610cf2a6c7aaf9855b54cd0453f347edf9c1a855 (diff) | |
download | kdepimpi-56450c0322c2335a59ae8d8796e41397cdb09329.zip kdepimpi-56450c0322c2335a59ae8d8796e41397cdb09329.tar.gz kdepimpi-56450c0322c2335a59ae8d8796e41397cdb09329.tar.bz2 |
better openfile dialogs / make dialogs explicit modal
-rw-r--r-- | pwmanager/pwmanager/addentrywndimpl.cpp | 3 | ||||
-rw-r--r-- | pwmanager/pwmanager/configwndimpl.cpp | 10 |
2 files changed, 13 insertions, 0 deletions
diff --git a/pwmanager/pwmanager/addentrywndimpl.cpp b/pwmanager/pwmanager/addentrywndimpl.cpp index 9e0fde9..73ba36c 100644 --- a/pwmanager/pwmanager/addentrywndimpl.cpp +++ b/pwmanager/pwmanager/addentrywndimpl.cpp | |||
@@ -23,32 +23,35 @@ | |||
23 | #include "addentrywndimpl.h" | 23 | #include "addentrywndimpl.h" |
24 | #include "pwmexception.h" | 24 | #include "pwmexception.h" |
25 | #include "pwgenwndimpl.h" | 25 | #include "pwgenwndimpl.h" |
26 | #ifndef PWM_EMBEDDED | 26 | #ifndef PWM_EMBEDDED |
27 | #include "advcommeditimpl.h" | 27 | #include "advcommeditimpl.h" |
28 | #endif | 28 | #endif |
29 | #include "htmlgen.h" | 29 | #include "htmlgen.h" |
30 | 30 | ||
31 | #include <kmessagebox.h> | 31 | #include <kmessagebox.h> |
32 | #include <klocale.h> | 32 | #include <klocale.h> |
33 | 33 | ||
34 | #include <qpushbutton.h> | 34 | #include <qpushbutton.h> |
35 | #include <qlabel.h> | 35 | #include <qlabel.h> |
36 | 36 | ||
37 | 37 | ||
38 | AddEntryWndImpl::AddEntryWndImpl() | 38 | AddEntryWndImpl::AddEntryWndImpl() |
39 | #ifdef PWM_EMBEDDED | ||
40 | : addEntryWnd( 0, "AddEntryWndImpl", TRUE) | ||
41 | #endif | ||
39 | { | 42 | { |
40 | editAdvCommentButton = 0; | 43 | editAdvCommentButton = 0; |
41 | commentTextEdit = 0; | 44 | commentTextEdit = 0; |
42 | switchComment(false); | 45 | switchComment(false); |
43 | pwGen = new PwGenWndImpl(this); | 46 | pwGen = new PwGenWndImpl(this); |
44 | } | 47 | } |
45 | 48 | ||
46 | AddEntryWndImpl::~AddEntryWndImpl() | 49 | AddEntryWndImpl::~AddEntryWndImpl() |
47 | { | 50 | { |
48 | delete_ifnot_null(editAdvCommentButton); | 51 | delete_ifnot_null(editAdvCommentButton); |
49 | delete_ifnot_null(commentTextEdit); | 52 | delete_ifnot_null(commentTextEdit); |
50 | delete pwGen; | 53 | delete pwGen; |
51 | } | 54 | } |
52 | 55 | ||
53 | void AddEntryWndImpl::okButton_slot() | 56 | void AddEntryWndImpl::okButton_slot() |
54 | { | 57 | { |
diff --git a/pwmanager/pwmanager/configwndimpl.cpp b/pwmanager/pwmanager/configwndimpl.cpp index 5aa38d4..595a6e7 100644 --- a/pwmanager/pwmanager/configwndimpl.cpp +++ b/pwmanager/pwmanager/configwndimpl.cpp | |||
@@ -24,54 +24,64 @@ | |||
24 | 24 | ||
25 | #include <qfileinfo.h> | 25 | #include <qfileinfo.h> |
26 | #include <qlineedit.h> | 26 | #include <qlineedit.h> |
27 | 27 | ||
28 | #include <kstandarddirs.h> | 28 | #include <kstandarddirs.h> |
29 | #include <kfiledialog.h> | 29 | #include <kfiledialog.h> |
30 | #include <klocale.h> | 30 | #include <klocale.h> |
31 | 31 | ||
32 | #include <stdlib.h> | 32 | #include <stdlib.h> |
33 | #include <stdio.h> | 33 | #include <stdio.h> |
34 | 34 | ||
35 | #ifdef PWM_EMBEDDED | 35 | #ifdef PWM_EMBEDDED |
36 | #include <kfontdialog.h> | 36 | #include <kfontdialog.h> |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | ConfigWndImpl::ConfigWndImpl() | 39 | ConfigWndImpl::ConfigWndImpl() |
40 | #ifdef PWM_EMBEDDED | ||
41 | : configWnd(0, "ConfigWndImpl", TRUE) | ||
42 | #endif | ||
43 | |||
40 | { | 44 | { |
41 | } | 45 | } |
42 | 46 | ||
43 | ConfigWndImpl::~ConfigWndImpl() | 47 | ConfigWndImpl::~ConfigWndImpl() |
44 | { | 48 | { |
45 | } | 49 | } |
46 | 50 | ||
47 | void ConfigWndImpl::okButton_slot() | 51 | void ConfigWndImpl::okButton_slot() |
48 | { | 52 | { |
49 | done(0); | 53 | done(0); |
50 | } | 54 | } |
51 | 55 | ||
52 | void ConfigWndImpl::cancelButton_slot() | 56 | void ConfigWndImpl::cancelButton_slot() |
53 | { | 57 | { |
54 | done(1); | 58 | done(1); |
55 | } | 59 | } |
56 | 60 | ||
57 | void ConfigWndImpl::browseAutoStButton_slot() | 61 | void ConfigWndImpl::browseAutoStButton_slot() |
58 | { | 62 | { |
63 | #ifndef PWM_EMBEDDED | ||
59 | QString path(KFileDialog::getOpenFileName(QString::null, | 64 | QString path(KFileDialog::getOpenFileName(QString::null, |
60 | i18n("*.pwm|PwM Password file\n" | 65 | i18n("*.pwm|PwM Password file\n" |
61 | "*|All files"), this)); | 66 | "*|All files"), this)); |
67 | #else | ||
68 | QString path = locateLocal( "data", KGlobal::getAppName() + "/*.pwm"); | ||
69 | path = KFileDialog::getOpenFileName(filename, | ||
70 | i18n("password filename(*.pwm)"), this); | ||
71 | #endif | ||
62 | if (path != QString::null) | 72 | if (path != QString::null) |
63 | autoStartLineEdit->setText(path); | 73 | autoStartLineEdit->setText(path); |
64 | } | 74 | } |
65 | 75 | ||
66 | void ConfigWndImpl::selEntrFontButton_slot() | 76 | void ConfigWndImpl::selEntrFontButton_slot() |
67 | { | 77 | { |
68 | bool ok; | 78 | bool ok; |
69 | #ifndef PWM_EMBEDDED | 79 | #ifndef PWM_EMBEDDED |
70 | QFont fnt = QFontDialog::getFont(&ok, currentEntryFont, this); | 80 | QFont fnt = QFontDialog::getFont(&ok, currentEntryFont, this); |
71 | #else | 81 | #else |
72 | QFont fnt = KFontDialog::getFont(currentEntryFont, ok); | 82 | QFont fnt = KFontDialog::getFont(currentEntryFont, ok); |
73 | #endif | 83 | #endif |
74 | if (!ok) | 84 | if (!ok) |
75 | return; | 85 | return; |
76 | currEntrFont->setFont(fnt); | 86 | currEntrFont->setFont(fnt); |
77 | currEntrFont->setText(fnt.family()); | 87 | currEntrFont->setText(fnt.family()); |