aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Noldor2008-05-04 17:16:21 +0000
committerGravatar Noldor2008-05-04 17:16:21 +0000
commita7db13d3efd84923fb824a0a12c06cf71c1b4f85 (patch)
treed2706d65c9f5125a3c5becb98bcebaf9a70df7b3 /src/modules
parentmore theme dialog QT4 port (wip) (diff)
downloadKVIrc-a7db13d3efd84923fb824a0a12c06cf71c1b4f85.tar.gz
KVIrc-a7db13d3efd84923fb824a0a12c06cf71c1b4f85.tar.bz2
KVIrc-a7db13d3efd84923fb824a0a12c06cf71c1b4f85.zip
code cleanup
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1670 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/theme/managementdialog.cpp47
-rw-r--r--src/modules/theme/packthemedialog.cpp1
-rw-r--r--src/modules/theme/savethemedialog.cpp4
3 files changed, 7 insertions, 45 deletions
diff --git a/src/modules/theme/managementdialog.cpp b/src/modules/theme/managementdialog.cpp
index 3081e2992..959f78c80 100644
--- a/src/modules/theme/managementdialog.cpp
+++ b/src/modules/theme/managementdialog.cpp
@@ -150,25 +150,7 @@ KviThemeListBoxItem::~KviThemeListBoxItem()
{
delete m_pThemeInfo;
}
-/*
-void KviThemeListBoxItem::paint(QPainter * p)
-{
- KviTalListBoxText::paint(p);
- p->drawPixmap(LVI_BORDER,LVI_BORDER, *(g_pIconManager->getBigIcon(QString(KVI_BIGICON_THEME))) );
- int afterIcon = LVI_BORDER + LVI_ICON_SIZE + LVI_SPACING;
- int www = p->window().width() - (afterIcon + LVI_BORDER);
- m_pText->setLineWidth(www);
- m_pText->draw(p,afterIcon,LVI_BORDER,QRect(afterIcon,LVI_BORDER,www,p->window().height() - (LVI_BORDER * 2)),listBox()->viewport()->colorGroup());
-}
-int KviThemeListBoxItem::height(const KviTalListBox * lb) const
-{
- int iHeight = m_pText->height() + (2 * LVI_BORDER);
- if(iHeight < (LVI_ICON_SIZE + (2 * LVI_BORDER)))iHeight = LVI_ICON_SIZE + (2 * LVI_BORDER);
- return iHeight;
-}
-
-*/
KviThemeManagementDialog * KviThemeManagementDialog::m_pInstance = 0;
@@ -189,7 +171,6 @@ KviThemeManagementDialog::KviThemeManagementDialog(QWidget * parent)
hb->setMargin(1);
hb->setSpacing(1);
g->addWidget(hb,0,0);
- //g->addMultiCellWidget(hb,0,0,0,1);
QToolButton * tb;
QFrame * sep;
@@ -248,7 +229,6 @@ KviThemeManagementDialog::KviThemeManagementDialog(QWidget * parent)
this,SLOT(contextMenuRequested(const QPoint &)));
connect(m_pListBox,SIGNAL(itemSelectionChanged()),this,SLOT(enableDisableButtons()));
g->addWidget(m_pListBox,1,0);
- //g->addMultiCellWidget(m_pListBox,1,1,0,1);
KviDynamicToolTip * tip = new KviDynamicToolTip(m_pListBox);
connect(tip,SIGNAL(tipRequest(KviDynamicToolTip *,const QPoint &)),this,SLOT(tipRequest(KviDynamicToolTip *,const QPoint &)));
@@ -258,8 +238,6 @@ KviThemeManagementDialog::KviThemeManagementDialog(QWidget * parent)
connect(b,SIGNAL(clicked()),this,SLOT(closeClicked()));
g->addWidget(b,2,0);
- g->setRowStretch(2,10);
-// g->setColumnStretch(0,1);
g->setMargin(1);
g->setSpacing(1);
g->setAlignment(b,Qt::AlignRight);
@@ -308,11 +286,7 @@ void KviThemeManagementDialog::packTheme()
dl.setAutoDelete(false);
QList<QListWidgetItem*> itemsSelected = m_pListBox->selectedItems ();
for(int i=0;i<itemsSelected.count();i++)
-// for(KviThemeListBoxItem * it = (KviThemeListBoxItem *)m_pListBox->firstItem();it;it = (KviThemeListBoxItem *)it->next())
- {
- // if(it->isSelected())
- dl.append(((KviThemeListBoxItem *)itemsSelected.at(i))->themeInfo());
- }
+ dl.append(((KviThemeListBoxItem *)itemsSelected.at(i))->themeInfo());
if(dl.isEmpty())return;
KviPackThemeDialog * pDialog = new KviPackThemeDialog(this,&dl);
@@ -368,16 +342,11 @@ void KviThemeManagementDialog::deleteTheme()
{
QList<QListWidgetItem*> itemsSelected = m_pListBox->selectedItems ();
for(int i=0;i<itemsSelected.count();i++)
-// for(KviThemeListBoxItem * pItem = (KviThemeListBoxItem *)m_pListBox->firstItem();pItem;pItem = (KviThemeListBoxItem *)pItem->next())
{
- // if(pItem->isSelected())
- // {
if(!KviMessageBox::yesNo(__tr2qs_ctx("Delete Theme - KVIrc","theme"),
__tr2qs_ctx("Do you really wish to delete theme \"%Q\" (version %Q)?","theme"),
&(((KviThemeListBoxItem *)itemsSelected.at(i))->themeInfo()->name()),&(((KviThemeListBoxItem *)itemsSelected.at(i))->themeInfo()->version())))goto jump_out;
-
KviFileUtils::deleteDir(((KviThemeListBoxItem *)itemsSelected.at(i))->themeInfo()->absoluteDirectory());
- // }
}
jump_out:
fillThemeBox();
@@ -391,7 +360,6 @@ void KviThemeManagementDialog::installFromFile()
if(!KviFileDialog::askForOpenFileName(szFileName,__tr2qs_ctx("Open Theme - KVIrc","theme"),QString::null,"*.kvt"))
return;
-
if(!KviThemeFunctions::installThemePackage(szFileName,szError,this))
{
KviMessageBox::information(szError);
@@ -456,16 +424,9 @@ void KviThemeManagementDialog::fillThemeBox()
bool KviThemeManagementDialog::hasSelectedItems()
{
-QList<QListWidgetItem*> itemsSelected = m_pListBox->selectedItems ();
-return itemsSelected.count()?true:false;
- /*for(int i=0;i<itemsSelected.count();i++)
-
- for(KviTalListBoxItem * it = m_pListBox->firstItem();it;it = it->next())
- {
- if(it->isSelected())return true;
- }
- return false;
- */
+ QList<QListWidgetItem*> itemsSelected = m_pListBox->selectedItems ();
+ return itemsSelected.count()?true:false;
+
}
void KviThemeManagementDialog::enableDisableButtons()
diff --git a/src/modules/theme/packthemedialog.cpp b/src/modules/theme/packthemedialog.cpp
index 9b1d4f2ea..71e6e2936 100644
--- a/src/modules/theme/packthemedialog.cpp
+++ b/src/modules/theme/packthemedialog.cpp
@@ -56,7 +56,6 @@
#include <QBuffer>
#include <QLabel>
-//#include <q3multilineedit.h>
KviPackThemeDialog::KviPackThemeDialog(QWidget * pParent,KviPointerList<KviThemeInfo> * pThemeInfoList)
diff --git a/src/modules/theme/savethemedialog.cpp b/src/modules/theme/savethemedialog.cpp
index 8831cf76f..527f62a26 100644
--- a/src/modules/theme/savethemedialog.cpp
+++ b/src/modules/theme/savethemedialog.cpp
@@ -70,6 +70,7 @@ KviSaveThemeDialog::KviSaveThemeDialog(QWidget * pParent)
QGridLayout * pLayout = new QGridLayout(pPage);
QLabel * pLabel = new QLabel(pPage);
+ pLabel->setWordWrap(true);
QString szText = "<p>";
szText += __tr2qs_ctx("This procedure allows you to save the current theme settings to a single directory. It is useful if you want to apply other themes or play with the theme settings and later come back to this theme with a single click. It will also allow you to manually modify the theme settings and later export them to a distributable package.","theme");
szText += "</p><p>";
@@ -95,6 +96,7 @@ KviSaveThemeDialog::KviSaveThemeDialog(QWidget * pParent)
pLabel = new QLabel(pPage);
pLabel->setText(__tr2qs_ctx("Here you need to provide informations about you (the author) and a short description of the theme you're creating.","theme"));
+ pLabel->setWordWrap(true);
pLabel->setTextFormat(Qt::RichText);
pLayout->addMultiCellWidget(pLabel,0,0,0,1);
@@ -147,7 +149,7 @@ KviSaveThemeDialog::KviSaveThemeDialog(QWidget * pParent)
pLabel = new QLabel(pPage);
pLabel->setText(__tr2qs_ctx("Here you can either choose a screenshot image from disk or make one now. The screenshot will be displayed in the tooltips of the theme management dialog and will be also visible in the package installation dialog if you will export the theme to a distributable package.","theme"));
- pLabel->setWordWrap(true);
+ pLabel->setWordWrap(true);
pLabel->setTextFormat(Qt::RichText);
pLayout->addWidget(pLabel,0,0);