mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-04-07 14:09:22 +08:00
[win-nix] log update actions
This commit is contained in:
@ -181,11 +181,23 @@ void CWinPanel::goStartPage()
|
||||
m_pMainPanel->goStart();
|
||||
}
|
||||
|
||||
void CWinPanel::doClose()
|
||||
{
|
||||
QTimer::singleShot(500, this, [=]{
|
||||
m_pMainPanel->pushButtonCloseClicked();
|
||||
});
|
||||
}
|
||||
|
||||
void CWinPanel::focus()
|
||||
{
|
||||
m_pMainPanel->focus();
|
||||
}
|
||||
|
||||
void CWinPanel::updatePanelStylesheets()
|
||||
{
|
||||
m_pMainPanel->updateStylesheets();
|
||||
}
|
||||
|
||||
void CWinPanel::applyWindowState(Qt::WindowState state)
|
||||
{
|
||||
m_pMainPanel->applyMainWindowState(state);
|
||||
@ -198,13 +210,6 @@ void CWinPanel::slot_windowClose()
|
||||
// PostQuitMessage(0);
|
||||
}
|
||||
|
||||
void CWinPanel::doClose()
|
||||
{
|
||||
QTimer::singleShot(500, this, [=]{
|
||||
m_pMainPanel->pushButtonCloseClicked();
|
||||
});
|
||||
}
|
||||
|
||||
void CWinPanel::slot_windowChangeState(Qt::WindowState s)
|
||||
{
|
||||
int cmdShow = SW_RESTORE;
|
||||
@ -232,7 +237,6 @@ void CWinPanel::slot_mainPageReady()
|
||||
|
||||
#ifdef _UPDMODULE
|
||||
QString _prod_name = WINDOW_NAME;
|
||||
qDebug() << "update's window title: " << _prod_name;
|
||||
|
||||
GET_REGISTRY_USER(_user)
|
||||
if (!_user.contains("CheckForUpdates")) {
|
||||
@ -245,13 +249,46 @@ void CWinPanel::slot_mainPageReady()
|
||||
win_sparkle_set_appcast_url(URL_APPCAST_UPDATES);
|
||||
win_sparkle_set_registry_path(QString("Software\\%1\\%2").arg(REG_GROUP_KEY).arg(REG_APP_NAME).toLatin1());
|
||||
win_sparkle_set_lang(CLangater::getLanguageName().toLatin1());
|
||||
|
||||
win_sparkle_set_did_find_update_callback(&CWinPanel::updateFound);
|
||||
win_sparkle_set_did_not_find_update_callback(&CWinPanel::updateNotFound);
|
||||
win_sparkle_set_error_callback(&CWinPanel::updateError);
|
||||
|
||||
win_sparkle_init();
|
||||
|
||||
m_pMainPanel->cmdMainPage("updates", "on");
|
||||
CLogger::log(QString("updates is on: ") + URL_APPCAST_UPDATES);
|
||||
#endif
|
||||
}
|
||||
|
||||
void CWinPanel::updatePanelStylesheets()
|
||||
#if defined(_UPDMODULE)
|
||||
#include "mainwindow.h"
|
||||
|
||||
extern HWND gTopWinId;
|
||||
|
||||
CWinPanel * getInstance()
|
||||
{
|
||||
m_pMainPanel->updateStylesheets();
|
||||
if ( gTopWinId ) {
|
||||
CMainWindow * window = reinterpret_cast<CMainWindow *>( GetWindowLongPtr( gTopWinId, GWLP_USERDATA ) );
|
||||
if ( window )
|
||||
return window->m_pWinPanel;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void CWinPanel::updateFound()
|
||||
{
|
||||
CLogger::log("found updates");
|
||||
}
|
||||
|
||||
void CWinPanel::updateNotFound()
|
||||
{
|
||||
CLogger::log("updates isn't found");
|
||||
}
|
||||
|
||||
void CWinPanel::updateError()
|
||||
{
|
||||
CLogger::log("updates error");
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -65,6 +65,13 @@ private:
|
||||
CAscApplicationManager * m_pManager;
|
||||
CMainPanelImpl * m_pMainPanel;
|
||||
|
||||
private:
|
||||
#ifdef _UPDMODULE
|
||||
static void updateFound();
|
||||
static void updateNotFound();
|
||||
static void updateError();
|
||||
#endif
|
||||
|
||||
private slots:
|
||||
void slot_windowClose();
|
||||
void slot_windowChangeState(Qt::WindowState);
|
||||
|
||||
Reference in New Issue
Block a user