|
|
@ -31,6 +31,7 @@ |
|
|
|
#include <QCDEStyle> |
|
|
|
#include <QCDEStyle> |
|
|
|
#include <QDialogButtonBox> |
|
|
|
#include <QDialogButtonBox> |
|
|
|
#include <QCloseEvent> |
|
|
|
#include <QCloseEvent> |
|
|
|
|
|
|
|
#include <QDesktopWidget> |
|
|
|
#ifdef Q_WS_WIN |
|
|
|
#ifdef Q_WS_WIN |
|
|
|
#include <QWindowsXPStyle> |
|
|
|
#include <QWindowsXPStyle> |
|
|
|
#endif |
|
|
|
#endif |
|
|
@ -240,6 +241,8 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ |
|
|
|
} |
|
|
|
} |
|
|
|
// Tab selection mecanism
|
|
|
|
// Tab selection mecanism
|
|
|
|
connect(tabSelection, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(changePage(QListWidgetItem *, QListWidgetItem*))); |
|
|
|
connect(tabSelection, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(changePage(QListWidgetItem *, QListWidgetItem*))); |
|
|
|
|
|
|
|
// Adapt size
|
|
|
|
|
|
|
|
adaptToScreenSize(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Main destructor
|
|
|
|
// Main destructor
|
|
|
@ -281,6 +284,24 @@ void options_imp::useStyle(){ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void options_imp::adaptToScreenSize() { |
|
|
|
|
|
|
|
int scrn = 0; |
|
|
|
|
|
|
|
QWidget *w = this->topLevelWidget(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(w) |
|
|
|
|
|
|
|
scrn = QApplication::desktop()->screenNumber(w); |
|
|
|
|
|
|
|
else if(QApplication::desktop()->isVirtualDesktop()) |
|
|
|
|
|
|
|
scrn = QApplication::desktop()->screenNumber(QCursor::pos()); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
scrn = QApplication::desktop()->screenNumber(this); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QRect desk(QApplication::desktop()->availableGeometry(scrn)); |
|
|
|
|
|
|
|
if(width() > desk.width() || height() > desk.height()) { |
|
|
|
|
|
|
|
if(desk.width() > 0 && desk.height() > 0) |
|
|
|
|
|
|
|
resize(desk.width(), desk.height()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void options_imp::saveOptions(){ |
|
|
|
void options_imp::saveOptions(){ |
|
|
|
applyButton->setEnabled(false); |
|
|
|
applyButton->setEnabled(false); |
|
|
|
QSettings settings("qBittorrent", "qBittorrent"); |
|
|
|
QSettings settings("qBittorrent", "qBittorrent"); |
|
|
|