Moved set_window_icon() function into MUtilities function.
This commit is contained in:
parent
06db588742
commit
187f1bbfb8
@ -35,7 +35,7 @@
|
||||
#define VER_LAMEXP_MINOR_LO 1
|
||||
#define VER_LAMEXP_TYPE Beta
|
||||
#define VER_LAMEXP_PATCH 4
|
||||
#define VER_LAMEXP_BUILD 1612
|
||||
#define VER_LAMEXP_BUILD 1613
|
||||
#define VER_LAMEXP_CONFG 1558
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -232,7 +232,6 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel_MetaInfo *me
|
||||
m_fileListModel(fileListModel),
|
||||
m_metaData(metaInfo),
|
||||
m_settings(settingsModel),
|
||||
m_windowIcon(NULL),
|
||||
m_fileSystemModel(NULL),
|
||||
m_banner(NULL),
|
||||
m_accepted(false),
|
||||
@ -245,7 +244,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel_MetaInfo *me
|
||||
setWindowFlags(windowFlags() ^ Qt::WindowMaximizeButtonHint);
|
||||
|
||||
//Create window icon
|
||||
m_windowIcon = lamexp_set_window_icon(this, lamexp_app_icon(), true);
|
||||
MUtils::GUI::set_window_icon(this, lamexp_app_icon(), true);
|
||||
|
||||
//Register meta types
|
||||
qRegisterMetaType<AudioFileModel>("AudioFileModel");
|
||||
@ -749,13 +748,6 @@ MainWindow::~MainWindow(void)
|
||||
MUTILS_DELETE(m_evenFilterOutputFolderMouse);
|
||||
MUTILS_DELETE(m_evenFilterOutputFolderView);
|
||||
MUTILS_DELETE(m_evenFilterCompressionTab);
|
||||
|
||||
//Free window icon
|
||||
if(m_windowIcon)
|
||||
{
|
||||
lamexp_free_window_icon(m_windowIcon);
|
||||
m_windowIcon = NULL;
|
||||
}
|
||||
|
||||
//Un-initialize the dialog
|
||||
MUTILS_DELETE(ui);
|
||||
|
@ -197,7 +197,6 @@ private:
|
||||
bool m_firstTimeShown;
|
||||
uint m_outputFolderViewInitCounter;
|
||||
bool m_outputFolderViewCentering;
|
||||
lamexp_icon_t *m_windowIcon;
|
||||
|
||||
WorkingBanner *m_banner;
|
||||
QList<QUrl> *m_droppedFileList;
|
||||
|
@ -149,7 +149,6 @@ ProcessingDialog::ProcessingDialog(FileListModel *fileListModel, const AudioFile
|
||||
:
|
||||
QDialog(parent),
|
||||
ui(new Ui::ProcessingDialog),
|
||||
m_windowIcon(NULL),
|
||||
m_systemTray(new QSystemTrayIcon(QIcon(":/icons/cd_go.png"), this)),
|
||||
m_settings(settings),
|
||||
m_metaInfo(metaInfo),
|
||||
@ -168,7 +167,7 @@ ProcessingDialog::ProcessingDialog(FileListModel *fileListModel, const AudioFile
|
||||
setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint);
|
||||
|
||||
//Update the window icon
|
||||
m_windowIcon = lamexp_set_window_icon(this, lamexp_app_icon(), true);
|
||||
MUtils::GUI::set_window_icon(this, lamexp_app_icon(), true);
|
||||
|
||||
//Update header icon
|
||||
ui->label_headerIcon->setPixmap(lamexp_app_icon().pixmap(ui->label_headerIcon->size()));
|
||||
@ -361,12 +360,6 @@ ProcessingDialog::~ProcessingDialog(void)
|
||||
|
||||
WinSevenTaskbar::setOverlayIcon(this, NULL);
|
||||
WinSevenTaskbar::setTaskbarState(this, WinSevenTaskbar::WinSevenTaskbarNoState);
|
||||
|
||||
if(m_windowIcon)
|
||||
{
|
||||
lamexp_free_window_icon(m_windowIcon);
|
||||
m_windowIcon = NULL;
|
||||
}
|
||||
|
||||
MUTILS_DELETE(ui);
|
||||
}
|
||||
|
@ -107,7 +107,6 @@ private:
|
||||
bool shutdownComputer(void);
|
||||
QString time2text(const double timeVal) const;
|
||||
|
||||
lamexp_icon_t *m_windowIcon;
|
||||
QThreadPool *m_threadPool;
|
||||
QList<AudioFileModel> m_pendingJobs;
|
||||
SettingsModel *m_settings;
|
||||
|
@ -72,9 +72,6 @@ typedef enum
|
||||
}
|
||||
lamexp_syscolor_t;
|
||||
|
||||
//Icon type
|
||||
class lamexp_icon_t;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// GLOBAL FUNCTIONS
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -95,7 +92,6 @@ const QString lamexp_clean_filepath(const QString &str);
|
||||
unsigned long lamexp_dbg_private_bytes(void);
|
||||
bool lamexp_enable_close_button(const QWidget *win, const bool bEnable = true);
|
||||
void lamexp_finalization(void);
|
||||
void lamexp_free_window_icon(lamexp_icon_t *icon);
|
||||
int lamexp_init_ipc(void);
|
||||
bool lamexp_install_translator(const QString &language);
|
||||
bool lamexp_install_translator_from_file(const QString &qmFile);
|
||||
@ -109,7 +105,6 @@ bool lamexp_play_sound_alias(const QString &alias, const bool bAsync);
|
||||
bool lamexp_portable_mode(void);
|
||||
QStringList lamexp_query_translations(void);
|
||||
void lamexp_register_tool(const QString &toolName, LockedFile *file, unsigned int version = 0, const QString *tag = NULL);
|
||||
lamexp_icon_t *lamexp_set_window_icon(QWidget *window, const QIcon &icon, const bool bIsBigIcon);
|
||||
bool lamexp_sheet_of_glass(QWidget *window);
|
||||
bool lamexp_sheet_of_glass_update(QWidget *window);
|
||||
QColor lamexp_system_color(const int color_id);
|
||||
|
@ -109,17 +109,7 @@ const char *lamexp_tracker_url(void) { return g_lamexp_tracker_url; }
|
||||
*/
|
||||
bool lamexp_version_demo(void)
|
||||
{
|
||||
char buffer[128];
|
||||
bool releaseVersion = false;
|
||||
if(!strncpy_s(buffer, 128, g_lamexp_version.ver_release_name, _TRUNCATE))
|
||||
{
|
||||
char *context, *prefix = strtok_s(buffer, "-,; ", &context);
|
||||
if(prefix)
|
||||
{
|
||||
releaseVersion = (!_stricmp(prefix, "Final")) || (!_stricmp(prefix, "Hotfix"));
|
||||
}
|
||||
}
|
||||
return (!releaseVersion);
|
||||
return _strnicmp(g_lamexp_version.ver_release_name, "Final", 5) && _strnicmp(g_lamexp_version.ver_release_name, "Hotfix", 6);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -585,34 +585,6 @@ bool lamexp_sheet_of_glass_update(QWidget *window)
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Update the window icon
|
||||
*/
|
||||
lamexp_icon_t *lamexp_set_window_icon(QWidget *window, const QIcon &icon, const bool bIsBigIcon)
|
||||
{
|
||||
if(!icon.isNull())
|
||||
{
|
||||
const int extend = (bIsBigIcon ? 32 : 16);
|
||||
if(HICON hIcon = lamexp_qicon2hicon(icon, extend, extend))
|
||||
{
|
||||
SendMessage(window->winId(), WM_SETICON, (bIsBigIcon ? ICON_BIG : ICON_SMALL), LPARAM(hIcon));
|
||||
return reinterpret_cast<lamexp_icon_t*>(hIcon);
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Free window icon
|
||||
*/
|
||||
void lamexp_free_window_icon(lamexp_icon_t *icon)
|
||||
{
|
||||
if(HICON hIcon = reinterpret_cast<HICON>(icon))
|
||||
{
|
||||
DestroyIcon(hIcon);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Get system color info
|
||||
*/
|
||||
|
@ -236,5 +236,5 @@ static int lamexp_main(int &argc, char **argv)
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
return MUtils::Startup::startup(argc, argv, lamexp_main);
|
||||
return MUtils::Startup::startup(argc, argv, lamexp_main, lamexp_version_demo());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user