|
|
@ -92,7 +92,7 @@ using namespace libtorrent; |
|
|
|
*****************************************************/ |
|
|
|
*****************************************************/ |
|
|
|
|
|
|
|
|
|
|
|
// Constructor
|
|
|
|
// Constructor
|
|
|
|
MainWindow::MainWindow(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), force_exit(false) { |
|
|
|
MainWindow::MainWindow(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), m_posInitialized(false), force_exit(false) { |
|
|
|
setupUi(this); |
|
|
|
setupUi(this); |
|
|
|
Preferences pref; |
|
|
|
Preferences pref; |
|
|
|
ui_locked = pref.isUILocked(); |
|
|
|
ui_locked = pref.isUILocked(); |
|
|
@ -458,7 +458,10 @@ void MainWindow::writeSettings() { |
|
|
|
void MainWindow::readSettings() { |
|
|
|
void MainWindow::readSettings() { |
|
|
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); |
|
|
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); |
|
|
|
settings.beginGroup(QString::fromUtf8("MainWindow")); |
|
|
|
settings.beginGroup(QString::fromUtf8("MainWindow")); |
|
|
|
|
|
|
|
if(settings.contains("geometry")) { |
|
|
|
restoreGeometry(settings.value("geometry").toByteArray()); |
|
|
|
restoreGeometry(settings.value("geometry").toByteArray()); |
|
|
|
|
|
|
|
m_posInitialized = true; |
|
|
|
|
|
|
|
} |
|
|
|
const QByteArray splitterState = settings.value("vsplitterState").toByteArray(); |
|
|
|
const QByteArray splitterState = settings.value("vsplitterState").toByteArray(); |
|
|
|
if(splitterState.isEmpty()) { |
|
|
|
if(splitterState.isEmpty()) { |
|
|
|
// Default sizes
|
|
|
|
// Default sizes
|
|
|
@ -680,7 +683,14 @@ void MainWindow::showEvent(QShowEvent *e) { |
|
|
|
if(getCurrentTabWidget() == transferList) { |
|
|
|
if(getCurrentTabWidget() == transferList) { |
|
|
|
properties->loadDynamicData(); |
|
|
|
properties->loadDynamicData(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
e->accept(); |
|
|
|
e->accept(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Make sure the window is initially centered
|
|
|
|
|
|
|
|
if(!m_posInitialized) { |
|
|
|
|
|
|
|
move(misc::screenCenter(this)); |
|
|
|
|
|
|
|
m_posInitialized = true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Called when we close the program
|
|
|
|
// Called when we close the program
|
|
|
|