|
|
|
@ -220,7 +220,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
@@ -220,7 +220,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
|
|
|
|
transferListFilters->getStatusFilters()->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); |
|
|
|
|
|
|
|
|
|
if(Preferences::startMinimized()) { |
|
|
|
|
setWindowState(Qt::WindowMinimized); |
|
|
|
|
showMinimized(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
qDebug("GUI Built"); |
|
|
|
@ -342,6 +342,7 @@ void GUI::tab_changed(int new_tab) {
@@ -342,6 +342,7 @@ void GUI::tab_changed(int new_tab) {
|
|
|
|
|
void GUI::writeSettings() { |
|
|
|
|
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); |
|
|
|
|
settings.beginGroup(QString::fromUtf8("MainWindow")); |
|
|
|
|
settings.setValue("IsMaximized", isMaximized()); |
|
|
|
|
settings.setValue(QString::fromUtf8("size"), size()); |
|
|
|
|
settings.setValue(QString::fromUtf8("pos"), pos()); |
|
|
|
|
// Splitter size
|
|
|
|
@ -407,6 +408,8 @@ void GUI::readSettings() {
@@ -407,6 +408,8 @@ void GUI::readSettings() {
|
|
|
|
|
settings.beginGroup(QString::fromUtf8("MainWindow")); |
|
|
|
|
resize(settings.value(QString::fromUtf8("size"), size()).toSize()); |
|
|
|
|
move(settings.value(QString::fromUtf8("pos"), misc::screenCenter(this)).toPoint()); |
|
|
|
|
if(settings.value("IsMaximized", false).toBool()) |
|
|
|
|
showMaximized(); |
|
|
|
|
const QStringList &sizes_str = settings.value("vSplitterSizes", QStringList()).toStringList(); |
|
|
|
|
// Splitter size
|
|
|
|
|
QList<int> sizes; |
|
|
|
@ -606,12 +609,16 @@ void GUI::on_actionCreate_torrent_triggered() {
@@ -606,12 +609,16 @@ void GUI::on_actionCreate_torrent_triggered() {
|
|
|
|
|
|
|
|
|
|
bool GUI::event(QEvent * e) { |
|
|
|
|
if(e->type() == QEvent::WindowStateChange) { |
|
|
|
|
qDebug("Window change event"); |
|
|
|
|
//Now check to see if the window is minimised
|
|
|
|
|
if(isMinimized()) { |
|
|
|
|
qDebug("minimisation"); |
|
|
|
|
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); |
|
|
|
|
if(systrayIcon && settings.value(QString::fromUtf8("Preferences/General/MinimizeToTray"), false).toBool()) { |
|
|
|
|
hide(); |
|
|
|
|
qDebug("Minimize to Tray enabled, hiding!"); |
|
|
|
|
e->accept(); |
|
|
|
|
QTimer::singleShot(0, this, SLOT(hide())); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|