diff options
| author | 2015-08-24 23:14:12 +0200 | |
|---|---|---|
| committer | 2015-08-24 23:14:12 +0200 | |
| commit | f4f17c33134d004f62967a434c5612a4f75a7e37 (patch) | |
| tree | 6b6938ff10551146e2ab492c9d0c14fcf2b95f4c /src/modules/setup | |
| parent | Fix modality of option dialogs (diff) | |
| download | KVIrc-f4f17c33134d004f62967a434c5612a4f75a7e37.tar.gz KVIrc-f4f17c33134d004f62967a434c5612a4f75a7e37.tar.bz2 KVIrc-f4f17c33134d004f62967a434c5612a4f75a7e37.zip | |
Fix modality of setup directory selection dialog
Diffstat (limited to 'src/modules/setup')
| -rw-r--r-- | src/modules/setup/SetupWizard.cpp | 45 | ||||
| -rw-r--r-- | src/modules/setup/libkvisetup.cpp | 1 |
2 files changed, 27 insertions, 19 deletions
diff --git a/src/modules/setup/SetupWizard.cpp b/src/modules/setup/SetupWizard.cpp index 3a7fcf6d5..a75a6ed6f 100644 --- a/src/modules/setup/SetupWizard.cpp +++ b/src/modules/setup/SetupWizard.cpp @@ -134,9 +134,10 @@ SetupPage::~SetupPage() SetupWizard::SetupWizard() : KviTalWizard(0) { - setModal(true); setWindowTitle(__tr2qs("KVIrc Setup")); + setWindowModality(Qt::NonModal); // non modal, otherwise the dialogs we show will not be usable + g_bFoundMirc = false; QString szLabelText; @@ -710,28 +711,36 @@ void SetupWizard::portableClicked() void SetupWizard::chooseOldDataPath() { // FIXME: We'd like to show hidden directories here ($HOME/.kvirc is hidden)... - QString szBuffer = KviTalFileDialog::getExistingDirectoryPath(m_pDataPathEdit->text(),__tr2qs("Choose an Old Configuration Folder - KVIrc Setup"),0); + QString szBuffer = KviTalFileDialog::getExistingDirectoryPath( + m_pDataPathEdit->text(), + __tr2qs("Choose an Old Configuration Folder - KVIrc Setup"), + this + ); + + if(szBuffer.isEmpty()) + return; + KviFileUtils::adjustFilePath(szBuffer); - if(!szBuffer.isEmpty()) + + KviQString::ensureLastCharIs(szBuffer,KVI_PATH_SEPARATOR_CHAR); + if(!g_pApp->checkLocalKvircDirectory(szBuffer)) { - KviQString::ensureLastCharIs(szBuffer,KVI_PATH_SEPARATOR_CHAR); - if(!g_pApp->checkLocalKvircDirectory(szBuffer)) - { - if( - QMessageBox::question( + if( + QMessageBox::question( this, __tr2qs("Do not overwrite folder? - KVIrc"), - tr("A folder %1 seems to be not a valid KVIrc settings folder." - "Do you want to use it anyway?") - .arg( szBuffer ), - __tr2qs("&Yes"), __tr2qs("&No"), - QString(), 0, 1 ) == 0 - ) { - m_pOldDataPathEdit->setText(szBuffer); - } - } else { + __tr2qs("The folder %1 does not seem to be a valid KVIrc settings folder. Do you want to use it anyway?") + .arg(szBuffer), + __tr2qs("&Yes"), + __tr2qs("&No"), + QString(), + 0, + 1 + ) == 0 + ) m_pOldDataPathEdit->setText(szBuffer); - } + } else { + m_pOldDataPathEdit->setText(szBuffer); } } diff --git a/src/modules/setup/libkvisetup.cpp b/src/modules/setup/libkvisetup.cpp index 7bbfbdd75..51d5b6ab1 100644 --- a/src/modules/setup/libkvisetup.cpp +++ b/src/modules/setup/libkvisetup.cpp @@ -57,7 +57,6 @@ KVIMODULEEXPORTFUNC bool setup_begin() { // FIXME: try to guess the user's .kvirc directory // and the preferred nickname from a previous installation - SetupWizard * w = new SetupWizard(); int retcode = w->exec(); delete w; |
