From 751840855dff580bc2f5debe6369cee2313bd3e2 Mon Sep 17 00:00:00 2001
From: Elvio Basello
Date: Wed, 26 Mar 2008 05:01:53 +0000
Subject: ported KviTalHBox and KviTalVBox to Qt4; removed some qt3 include
files and cleaned a bit the code around; moved config dir to ~/.config/KVIrc
according to LSB 2.0 standards; changed codename to 'Insomnia';
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1293 17fca916-40b9-46aa-a4ea-0a15b648b75c
---
src/modules/setup/setupwizard.cpp | 74 +++++++++++++++++++--------------------
1 file changed, 36 insertions(+), 38 deletions(-)
(limited to 'src/modules/setup/setupwizard.cpp')
diff --git a/src/modules/setup/setupwizard.cpp b/src/modules/setup/setupwizard.cpp
index e22bc91f5..379351158 100644
--- a/src/modules/setup/setupwizard.cpp
+++ b/src/modules/setup/setupwizard.cpp
@@ -4,7 +4,7 @@
// Creation date : Sat Oct 6 02:06:53 2001 GMT by Szymon Stefanek
//
// This file is part of the KVirc irc client distribution
-// Copyright (C) 2001-2004 Szymon Stefanek (pragma at kvirc dot net)
+// Copyright (C) 2001-2008 Szymon Stefanek (pragma at kvirc dot net)
//
// This program is FREE software. You can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@ -38,13 +38,15 @@ bool g_bFoundMirc;
#include "kvi_config.h"
#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "kvi_tal_hbox.h"
+#include "kvi_tal_hbox.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
#ifdef COMPILE_ON_WINDOWS
#include
@@ -55,9 +57,6 @@ bool g_bFoundMirc;
#include // for symlink()
#endif
-#ifdef COMPILE_USE_QT4
- #include
-#endif
// libkvisetup.cpp
extern QString g_szChoosenIncomingDirectory;
@@ -72,7 +71,7 @@ extern QString szMircIni;
#ifdef COMPILE_ON_WINDOWS
#define KVI_LOCAL_KVIRC_SUBDIRECTORY_NAME "KVIrc4"
#else
- #define KVI_LOCAL_KVIRC_SUBDIRECTORY_NAME ".kvirc4"
+ #define KVI_LOCAL_KVIRC_SUBDIRECTORY_NAME ".config/KVIrc"
#endif
KviSetupPage::KviSetupPage(KviSetupWizard * w)
@@ -125,9 +124,7 @@ KviSetupPage::KviSetupPage(KviSetupWizard * w)
l->setBackgroundColor(QColor(48,48,48));
m_pTextLabel = new QLabel(m_pVBox);
-#ifdef COMPILE_USE_QT4
m_pTextLabel->setWordWrap(true);
-#endif
m_pTextLabel->setAlignment(Qt::AlignJustify | Qt::AlignTop);
m_pVBox->setStretchFactor(m_pTextLabel,1);
}
@@ -184,13 +181,13 @@ KviSetupWizard::KviSetupWizard()
#ifndef COMPILE_ON_WINDOWS //it have been already shown by installer
KviSetupPage * m_pLicense = new KviSetupPage(this);
m_pLicense->m_pTextLabel->setText(__tr2qs( \
- "All of the files in this distribution are covered by the GPL. " \
- "In human terms this can be read as follows:
" \
- "
" \
- "- KVIrc is free, use it, have fun! :)
" \
- "- If you use any part of KVIrc in your own project, you must release that project under the same license.
" \
- "
" \
- "The \"legalese\" version of the license is shown in the box below.
"));
+ "All of the files in this distribution are covered by the GPL. " \
+ "In human terms this can be read as follows:
" \
+ "
" \
+ "- KVIrc is free, use it, have fun! :)
" \
+ "- If you use any part of KVIrc in your own project, you must release that project under the same license.
" \
+ "
" \
+ "The \"legalese\" version of the license is shown in the box below.
"));
KviTalTextEdit * ed = new KviTalTextEdit(m_pLicense->m_pVBox);
ed->setReadOnly(true);
@@ -201,8 +198,8 @@ KviSetupWizard::KviSetupWizard()
if(!KviFileUtils::loadFile(szLicensePath,szLicense))
{
szLicense = __tr("Oops... can't find the license file.\n" \
- "It MUST be included in the distribution...\n" \
- "Please report to ");
+ "It MUST be included in the distribution...\n" \
+ "Please report to ");
}
ed->setText(szLicense);
@@ -488,13 +485,13 @@ KviSetupWizard::KviSetupWizard()
m_pDesktopIntegration = new KviSetupPage(this);
szText = __tr2qs( \
- "" \
- "Here you can choose how much KVIrc will integrate with " \
- "your system." \
- "
" \
- "The default settings are fine for most users so if " \
- "you're in doubt just click \"Next\" and go to the next screen." \
- "
");
+ "" \
+ "Here you can choose how much KVIrc will integrate with " \
+ "your system." \
+ "
" \
+ "The default settings are fine for most users so if " \
+ "you're in doubt just click \"Next\" and go to the next screen." \
+ "
");
m_pDesktopIntegration->m_pTextLabel->setText(szText);
@@ -646,7 +643,7 @@ KviSetupWizard::KviSetupWizard()
}
free(buffer);
-#endif
+#endif // COMPILE_ON:WINDOWS
//setMinimumSize(630,450);
}
@@ -722,6 +719,7 @@ void KviSetupWizard::newDirClicked()
if(m_pDataPathEdit->text().isEmpty() || m_pIncomingPathEdit->text().isEmpty()) setNextEnabled(m_pDirectory,false);
else setNextEnabled(m_pDirectory,true);
}
+
void KviSetupWizard::chooseOldDataPath()
{
QString szBuffer = KviTalFileDialog::getExistingDirectoryPath(m_pDataPathEdit->text(),__tr2qs("Choose an Old Configuration Folder - KVIrc Setup"),0);
@@ -789,19 +787,19 @@ void KviSetupWizard::makeLink()
// otherwise there would be 150 lines for a stupid symlink!)
HKEY hCU;
- DWORD lpType;
- ULONG ulSize = MAX_PATH;
+ DWORD lpType;
+ ULONG ulSize = MAX_PATH;
char szLink[MAX_PATH];
// Dig in the registry looking up the Desktop path
- if(RegOpenKeyEx(HKEY_CURRENT_USER,
+ if(RegOpenKeyEx(HKEY_CURRENT_USER,
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",
0,KEY_QUERY_VALUE,&hCU) == ERROR_SUCCESS)
{
RegQueryValueEx(hCU,"Desktop",NULL,&lpType,
- (unsigned char *)&szLink,&ulSize);
+ (unsigned char *)&szLink,&ulSize);
RegCloseKey(hCU);
- }
+ }
// Build our paths
QString szLinkTarget = szLink;
@@ -816,8 +814,8 @@ void KviSetupWizard::makeLink()
// Fiddle with an obscure shell interface
IShellLink* psl;
- // Get a pointer to the IShellLink interface: this is kinda ugly :)
- if(CoCreateInstance(CLSID_ShellLink,NULL,CLSCTX_INPROC_SERVER,
+ // Get a pointer to the IShellLink interface: this is kinda ugly :)
+ if(CoCreateInstance(CLSID_ShellLink,NULL,CLSCTX_INPROC_SERVER,
IID_IShellLink,(void **)&psl) == S_OK)
{
// just for fun , lookup another shell interface
--
cgit v1.3.1-10-gc9f91