|
|
@ -34,20 +34,11 @@ |
|
|
|
#include <QSystemTrayIcon> |
|
|
|
#include <QSystemTrayIcon> |
|
|
|
#include <QApplication> |
|
|
|
#include <QApplication> |
|
|
|
#include <QSettings> |
|
|
|
#include <QSettings> |
|
|
|
#include <QPlastiqueStyle> |
|
|
|
|
|
|
|
#include "qgnomelook.h" |
|
|
|
#include "qgnomelook.h" |
|
|
|
#include <QMotifStyle> |
|
|
|
|
|
|
|
#include <QCDEStyle> |
|
|
|
|
|
|
|
#include <QDialogButtonBox> |
|
|
|
#include <QDialogButtonBox> |
|
|
|
#include <QCloseEvent> |
|
|
|
#include <QCloseEvent> |
|
|
|
#include <QDesktopWidget> |
|
|
|
#include <QDesktopWidget> |
|
|
|
#ifdef Q_WS_WIN |
|
|
|
#include <QStyleFactory> |
|
|
|
#include <QWindowsXPStyle> |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_MAC |
|
|
|
|
|
|
|
#include <QMacStyle> |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <time.h> |
|
|
|
#include <time.h> |
|
|
|
#include <stdlib.h> |
|
|
|
#include <stdlib.h> |
|
|
@ -72,12 +63,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
connect(buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(applySettings(QAbstractButton*))); |
|
|
|
connect(buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(applySettings(QAbstractButton*))); |
|
|
|
#ifdef Q_WS_WIN |
|
|
|
comboStyle->addItems(QStyleFactory::keys()); |
|
|
|
comboStyle->addItem("Windows XP Style (Windows Only)"); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef Q_WS_MAC |
|
|
|
|
|
|
|
comboStyle->addItem("MacOS Style (MacOS Only)"); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
// Languages supported
|
|
|
|
// Languages supported
|
|
|
|
comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/united_kingdom.png"))), QString::fromUtf8("English")); |
|
|
|
comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/united_kingdom.png"))), QString::fromUtf8("English")); |
|
|
|
locales << "en_GB"; |
|
|
|
locales << "en_GB"; |
|
|
@ -305,30 +291,15 @@ void options_imp::changePage(QListWidgetItem *current, QListWidgetItem *previous |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void options_imp::useStyle() { |
|
|
|
void options_imp::useStyle() { |
|
|
|
int style = getStyle(); |
|
|
|
if(comboStyle->currentIndex() == 0) { |
|
|
|
switch(style) { |
|
|
|
QApplication::setStyle(Preferences::getDefaultStyle()); |
|
|
|
case 1: |
|
|
|
} else { |
|
|
|
QApplication::setStyle(new QPlastiqueStyle()); |
|
|
|
QApplication::setStyle(QStyleFactory::create(comboStyle->itemText(comboStyle->currentIndex()))); |
|
|
|
break; |
|
|
|
} |
|
|
|
case 2: |
|
|
|
if(QApplication::style()->objectName() == "cleanlooks") { |
|
|
|
|
|
|
|
// Force our own cleanlooks style
|
|
|
|
|
|
|
|
qDebug("Forcing our own cleanlooks style"); |
|
|
|
QApplication::setStyle(new QGnomeLookStyle()); |
|
|
|
QApplication::setStyle(new QGnomeLookStyle()); |
|
|
|
break; |
|
|
|
|
|
|
|
case 3: |
|
|
|
|
|
|
|
QApplication::setStyle(new QMotifStyle()); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 4: |
|
|
|
|
|
|
|
QApplication::setStyle(new QCDEStyle()); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
#ifdef Q_WS_MAC |
|
|
|
|
|
|
|
case 5: |
|
|
|
|
|
|
|
QApplication::setStyle(new QMacStyle()); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef Q_WS_WIN |
|
|
|
|
|
|
|
case 6: |
|
|
|
|
|
|
|
QApplication::setStyle(new QWindowsXPStyle()); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -567,14 +538,19 @@ int options_imp::getHTTPProxyType() const { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int options_imp::getStyle() const{ |
|
|
|
QString options_imp::getStyle() const{ |
|
|
|
return comboStyle->currentIndex(); |
|
|
|
if(comboStyle->currentIndex() == 0) |
|
|
|
|
|
|
|
return "default"; |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
return comboStyle->itemText(comboStyle->currentIndex()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void options_imp::setStyle(int style){ |
|
|
|
void options_imp::setStyle(QString style) { |
|
|
|
if(style >= comboStyle->count() || style < 0) |
|
|
|
if(style != "default") { |
|
|
|
style = 0; |
|
|
|
int index = comboStyle->findText(style); |
|
|
|
comboStyle->setCurrentIndex(style); |
|
|
|
if(index > 0) |
|
|
|
|
|
|
|
comboStyle->setCurrentIndex(index); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool options_imp::isHTTPProxyAuthEnabled() const{ |
|
|
|
bool options_imp::isHTTPProxyAuthEnabled() const{ |
|
|
|