-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit fd228a7
Showing
20 changed files
with
967 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#ignore all build content but keep the folder | ||
build/* | ||
|
||
#ignore the deploy folder | ||
deploy/ | ||
|
||
#ignore all .user files | ||
*.user | ||
|
||
#ignore all useless icons | ||
icons/icon.*.fw.* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#------------------------------------------------- | ||
# | ||
# Project created by QtCreator 2015-11-11T12:41:18 | ||
# | ||
#------------------------------------------------- | ||
|
||
QT += core gui | ||
|
||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets | ||
|
||
TARGET = TaskBarSearch | ||
TEMPLATE = app | ||
|
||
SOURCES += main.cpp\ | ||
taskbarmenu.cpp \ | ||
settings.cpp | ||
|
||
HEADERS += taskbarmenu.h \ | ||
settings.h \ | ||
searchengine.h | ||
|
||
FORMS += taskbarmenu.ui \ | ||
settings.ui | ||
|
||
RESOURCES += \ | ||
resources.qrc | ||
|
||
RC_ICONS += \ | ||
icons/icon.ico |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[searchEngines] | ||
1\name=Google | ||
1\url="https://www.google.fr/#q=%s" | ||
2\name=RS | ||
2\url="http://fr.rs-online.com/web/c/?searchTerm=%s" | ||
size=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
@echo off | ||
echo ------------------------------------------------- | ||
echo Don't forget to add "C:\Qt\Tools\mingw492_32\bin" | ||
echo and "C:\Qt\5.5\android_x86\bin" | ||
echo to your path environement variable | ||
echo ------------------------------------------------- | ||
echo. | ||
echo. | ||
|
||
|
||
|
||
echo ------------------------------------------------- | ||
echo COMPILATION | ||
echo ------------------------------------------------- | ||
echo. | ||
|
||
rem // compilation of release version | ||
cd build | ||
qmake.exe ../TaskBarSearch.pro -r -spec win32-g++ | ||
mingw32-make.exe | ||
cd .. | ||
|
||
|
||
|
||
echo. | ||
echo. | ||
echo. | ||
echo ------------------------------------------------- | ||
echo Deployment | ||
echo ------------------------------------------------- | ||
echo. | ||
|
||
rem // deployment with qt for windows | ||
rmdir deploy /S /Q | ||
mkdir deploy | ||
mkdir deploy\TaskBarSearch | ||
copy "build\release\TaskBarSearch.exe" "deploy\TaskBarSearch\TaskBarSearch.exe" | ||
windeployqt --no-translations deploy/TaskBarSearch/ | ||
|
||
rem // copy some none essential files | ||
copy "default.ini" "deploy\TaskBarSearch\default.ini" | ||
|
||
|
||
|
||
echo. | ||
echo. | ||
echo. | ||
echo ------------------------------------------------- | ||
echo ZIP | ||
echo ------------------------------------------------- | ||
echo. | ||
|
||
rem // Zip everything | ||
cd deploy | ||
"%ProgramFiles%/7-zip/7z.exe" a TaskBarSearch.zip TaskBarSearch/ | ||
|
||
|
||
|
||
echo. | ||
echo ------------------------------------------------ | ||
echo. | ||
echo Script over | ||
echo. | ||
echo You can now "/deploy/TaskBarSearch" wherever you want | ||
echo. | ||
echo ------------------------------------------------ | ||
echo. | ||
pause | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#include "taskbarmenu.h" | ||
#include <QApplication> | ||
#include <QWidgetAction> | ||
#include <QMenu> | ||
#include <QSystemTrayIcon> | ||
#include <QIcon> | ||
#include <QMessageBox> | ||
#include <QFile> | ||
#include <QSettings> | ||
#include <QStandardPaths> | ||
#include <QFileInfo> | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
// Init app that do not quit without opened window | ||
QApplication a(argc, argv); | ||
a.setQuitOnLastWindowClosed(false); | ||
|
||
// Warn if the OS do not support system tray, then exit | ||
if(!QSystemTrayIcon::isSystemTrayAvailable()) | ||
{ | ||
QMessageBox errorMessage(QMessageBox::Critical, | ||
"System not supported", | ||
"The operating system do not provide any system tray or task bar.\n\nThe application will now exit." | ||
); | ||
errorMessage.exec(); | ||
return(0); | ||
} | ||
|
||
|
||
// Configre the app, essentialy for QSettings | ||
QCoreApplication::setOrganizationName("Sylvain-Mariel"); | ||
QCoreApplication::setOrganizationDomain("sylvain-mariel.fr"); | ||
QCoreApplication::setApplicationName("TaskBarSearch"); | ||
|
||
|
||
// Init settings | ||
#ifdef Q_OS_WIN | ||
// Special feature on Windows : load default settings if there is no settings. | ||
if(!QFile::exists(QCoreApplication::applicationDirPath()+"/settings.ini")) | ||
{ | ||
QFile::copy(QCoreApplication::applicationDirPath()+"/default.ini", QCoreApplication::applicationDirPath()+"/settings.ini"); | ||
} | ||
QSettings settings(QCoreApplication::applicationDirPath()+"/settings.ini", QSettings::IniFormat); | ||
|
||
// Speacial feature on Windows : overwrite auto startup setting depending on the file existance | ||
settings.setValue("autoStartup", | ||
QFile::exists( | ||
QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation) | ||
+ "/Startup/" | ||
+ QFileInfo( QCoreApplication::applicationFilePath() ).fileName()+".lnk")); | ||
#else | ||
// Other OS than Windows : just create settings wherever the OS want | ||
QSettings settings; | ||
#endif | ||
settings.sync(); | ||
|
||
|
||
// Create a sub-element of a menu that contain the custom UI | ||
QWidgetAction *trayWidget = new QWidgetAction(0); | ||
trayWidget->setDefaultWidget(new TaskBarMenu()); | ||
|
||
// Create a menu that contain the sub-element | ||
QMenu *trayMenu = new QMenu(); | ||
trayMenu->addAction(trayWidget); | ||
|
||
// Create a tray icon that show the menu on a right click | ||
QSystemTrayIcon *trayIcon = new QSystemTrayIcon(); | ||
trayIcon->setContextMenu(trayMenu); | ||
trayIcon->setIcon(QIcon(":/img/icons/icon.16.png")); | ||
trayIcon->show(); | ||
|
||
|
||
return a.exec(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<RCC> | ||
<qresource prefix="/img"> | ||
<file>icons/icon.16.png</file> | ||
</qresource> | ||
</RCC> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef SEARCHENGINE_H | ||
#define SEARCHENGINE_H | ||
#include <QString> | ||
#include <QUrl> | ||
|
||
struct SearchEngine { | ||
QString name; | ||
QString url; | ||
}; | ||
|
||
Q_DECLARE_METATYPE(SearchEngine); | ||
|
||
#endif // SEARCHENGINE_H |
Oops, something went wrong.