Browse Source

- Style is now applied instantly, no need to restart qBT

- Fixed a typo in WIndowsXP Style
adaptive-webui-19844
Christophe Dumez 18 years ago
parent
commit
81eee7bba2
  1. 2
      TODO
  2. 1
      src/main.cpp
  3. 2
      src/options.ui
  4. 43
      src/options_imp.cpp
  5. 1
      src/options_imp.h

2
TODO

@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
- Use a QListWidget to allow multiple input paths
- Possibility to add url seeds
- Add IPv6 support (at least start working on it, libtorrent seems to support it, we should limit our code to IPv4 anymore)
- UPnP support (debug, sync with next aMule release (or CVS)) : seems to be working!
- UPnP support (debug, sync with next aMule release) : seems to be working!
- Update v0.9.0 changelog after its release
- Display Url seeds in torrent properties and allow to edit them
- Improve Ipfilter.dat parser (move to a thread ? - too slow to load qBT and more importantly options)

1
src/main.cpp

@ -35,7 +35,6 @@ @@ -35,7 +35,6 @@
#ifdef Q_WS_WIN
#include <QWindowsXPStyle>
#endif
#ifdef Q_WS_MAC
#include <QMacStyle>
#endif

2
src/options.ui

@ -1600,7 +1600,7 @@ @@ -1600,7 +1600,7 @@
<bool>false</bool>
</property>
<property name="text" >
<string>WindowsXP style (WIndows XP only)</string>
<string>WindowsXP style (Windows XP only)</string>
</property>
</widget>
</item>

43
src/options_imp.cpp

@ -23,7 +23,19 @@ @@ -23,7 +23,19 @@
#include <QMessageBox>
#include <QInputDialog>
#include <QSystemTrayIcon>
#include <QApplication>
#include <QSettings>
#include <QPlastiqueStyle>
#include <QCleanlooksStyle>
#include <QMotifStyle>
#include <QCDEStyle>
#ifdef Q_WS_WIN
#include <QWindowsXPStyle>
#endif
#ifdef Q_WS_MAC
#include <QMacStyle>
#endif
#include "options_imp.h"
#include "misc.h"
@ -193,8 +205,39 @@ options_imp::~options_imp(){ @@ -193,8 +205,39 @@ options_imp::~options_imp(){
qDebug("-> destructing Options");
}
void options_imp::useStyle(){
QString style = getStyle();
if(style == "Cleanlooks"){
QApplication::setStyle(new QCleanlooksStyle());
return;
}
if(style == "Motif"){
QApplication::setStyle(new QMotifStyle());
return;
}
if(style == "CDE"){
QApplication::setStyle(new QCDEStyle());
return;
}
#ifdef Q_WS_MAC
if(style == "MacOS"){
QApplication::setStyle(new QMacStyle());
return;
}
#endif
#ifdef Q_WS_WIN
if(style == "WinXP"){
QApplication::setStyle(new QWindowsXPStyle());
return;
}
#endif
QApplication::setStyle(new QPlastiqueStyle());
}
void options_imp::saveOptions(){
QSettings settings("qBittorrent", "qBittorrent");
// Apply style
useStyle();
// Check if min port < max port
checkPortsLogic();
settings.beginGroup("Options");

1
src/options_imp.h

@ -112,6 +112,7 @@ class options_imp : public QDialog, private Ui::Dialog{ @@ -112,6 +112,7 @@ class options_imp : public QDialog, private Ui::Dialog{
public slots:
void setLocale(QString locale);
void useStyle();
signals:
void status_changed(const QString&, bool) const;

Loading…
Cancel
Save