|
|
|
@ -96,6 +96,7 @@ MainApplication::MainApplication(int &argc, char** argv) |
|
|
|
, m_desktopNotifications(0) |
|
|
|
, m_desktopNotifications(0) |
|
|
|
, m_autoSaver(0) |
|
|
|
, m_autoSaver(0) |
|
|
|
, m_proxyStyle(0) |
|
|
|
, m_proxyStyle(0) |
|
|
|
|
|
|
|
, m_lastActiveWindow(0) |
|
|
|
#if defined(Q_OS_WIN) && !defined(Q_OS_OS2) |
|
|
|
#if defined(Q_OS_WIN) && !defined(Q_OS_OS2) |
|
|
|
, m_registerQAppAssociation(0) |
|
|
|
, m_registerQAppAssociation(0) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
@ -266,6 +267,8 @@ MainApplication::MainApplication(int &argc, char** argv) |
|
|
|
BrowserWindow* window = createWindow(Qz::BW_FirstAppWindow, startUrl); |
|
|
|
BrowserWindow* window = createWindow(Qz::BW_FirstAppWindow, startUrl); |
|
|
|
connect(window, SIGNAL(startingCompleted()), this, SLOT(restoreOverrideCursor())); |
|
|
|
connect(window, SIGNAL(startingCompleted()), this, SLOT(restoreOverrideCursor())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
connect(this, SIGNAL(focusChanged(QWidget*,QWidget*)), this, SLOT(onFocusChanged())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isPrivate()) { |
|
|
|
if (!isPrivate()) { |
|
|
|
Settings settings; |
|
|
|
Settings settings; |
|
|
|
@ -350,10 +353,8 @@ QList<BrowserWindow*> MainApplication::windows() const |
|
|
|
|
|
|
|
|
|
|
|
BrowserWindow* MainApplication::getWindow() const |
|
|
|
BrowserWindow* MainApplication::getWindow() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
BrowserWindow* activeW = qobject_cast<BrowserWindow*>(activeWindow()); |
|
|
|
if (m_lastActiveWindow) { |
|
|
|
|
|
|
|
return m_lastActiveWindow; |
|
|
|
if (activeW) { |
|
|
|
|
|
|
|
return activeW; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return m_windows.isEmpty() ? 0 : m_windows.first(); |
|
|
|
return m_windows.isEmpty() ? 0 : m_windows.first(); |
|
|
|
@ -836,6 +837,15 @@ void MainApplication::windowDestroyed(QObject* window) |
|
|
|
m_windows.removeOne(static_cast<BrowserWindow*>(window)); |
|
|
|
m_windows.removeOne(static_cast<BrowserWindow*>(window)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainApplication::onFocusChanged() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
BrowserWindow* activeBrowserWindow = qobject_cast<BrowserWindow*>(activeWindow()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (activeBrowserWindow) { |
|
|
|
|
|
|
|
m_lastActiveWindow = activeBrowserWindow; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void MainApplication::loadSettings() |
|
|
|
void MainApplication::loadSettings() |
|
|
|
{ |
|
|
|
{ |
|
|
|
Settings settings; |
|
|
|
Settings settings; |
|
|
|
|