improved build script, popupmenu separator adding

This commit is contained in:
John Preston 2016-02-26 19:49:31 +03:00
parent ade6b5aae0
commit 9d9b4b83a1
4 changed files with 17 additions and 12 deletions

View file

@ -69,7 +69,7 @@ elif [ "$BuildTarget" == "macstore" ]; then
echo "Building version $AppVersionStrFull for Mac App Store.." echo "Building version $AppVersionStrFull for Mac App Store.."
ReleasePath="./../Mac/Release" ReleasePath="./../Mac/Release"
BinaryName="Telegram Desktop" BinaryName="Telegram Desktop"
DropboxPath="./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor" DropboxPath="./../../../Dropbox/$BinaryName/deploy/$AppVersionStrMajor"
DropboxDeployPath="$DropboxPath/$AppVersionStrFull" DropboxDeployPath="$DropboxPath/$AppVersionStrFull"
else else
echo "Invalid target!" echo "Invalid target!"
@ -109,7 +109,7 @@ fi
if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ]; then if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ]; then
DropboxSymbolsPath="/media/psf/Home/Dropbox/Telegram/symbols" DropboxSymbolsPath="/media/psf/Home/Dropbox/$BinaryName/symbols"
mkdir -p "$WorkPath/ReleaseIntermediateUpdater" mkdir -p "$WorkPath/ReleaseIntermediateUpdater"
cd "$WorkPath/ReleaseIntermediateUpdater" cd "$WorkPath/ReleaseIntermediateUpdater"
@ -123,7 +123,7 @@ if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ]; then
/usr/local/Qt-5.5.1/bin/qmake "$HomePath/Telegram.pro" -r -spec linux-g++ /usr/local/Qt-5.5.1/bin/qmake "$HomePath/Telegram.pro" -r -spec linux-g++
eval "$FixScript" eval "$FixScript"
make make
echo "Telegram build complete!" echo "$BinaryName build complete!"
cd "$HomePath" cd "$HomePath"
if [ ! -f "$ReleasePath/$BinaryName" ]; then if [ ! -f "$ReleasePath/$BinaryName" ]; then
echo "$BinaryName not found!" echo "$BinaryName not found!"
@ -178,18 +178,18 @@ if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ]; then
echo "Copying $BinaryName, Updater and $UpdateFile to deploy/$AppVersionStrMajor/$AppVersionStrFull.."; echo "Copying $BinaryName, Updater and $UpdateFile to deploy/$AppVersionStrMajor/$AppVersionStrFull..";
mkdir "$DeployPath" mkdir "$DeployPath"
mkdir "$DeployPath/$BinaryName" mkdir "$DeployPath/$BinaryName"
mv "$ReleasePath/$BinaryName" "$DeployPath/Telegram/" mv "$ReleasePath/$BinaryName" "$DeployPath/$BinaryName/"
mv "$ReleasePath/Updater" "$DeployPath/Telegram/" mv "$ReleasePath/Updater" "$DeployPath/$BinaryName/"
mv "$ReleasePath/$UpdateFile" "$DeployPath/" mv "$ReleasePath/$UpdateFile" "$DeployPath/"
if [ "$BetaVersion" != "0" ]; then if [ "$BetaVersion" != "0" ]; then
mv "$ReleasePath/$BetaKeyFile" "$DeployPath/" mv "$ReleasePath/$BetaKeyFile" "$DeployPath/"
fi fi
cd "$DeployPath" && tar -cJvf "$SetupFile" "Telegram/" && cd "./../../../$HomePath" cd "$DeployPath" && tar -cJvf "$SetupFile" "$BinaryName/" && cd "./../../../$HomePath"
fi fi
if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ] || [ "$BuildTarget" == "macstore" ]; then if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ] || [ "$BuildTarget" == "macstore" ]; then
DropboxSymbolsPath="./../../../Dropbox/Telegram/symbols" DropboxSymbolsPath="./../../../Dropbox/$BinaryName/symbols"
if [ "$FastParam" != "fast" ]; then if [ "$FastParam" != "fast" ]; then
touch "./SourceFiles/telegram.qrc" touch "./SourceFiles/telegram.qrc"
@ -307,10 +307,10 @@ if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ] || [ "$BuildTarg
if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ]; then if [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ]; then
echo "Copying $BinaryName.app and $UpdateFile to deploy/$AppVersionStrMajor/$AppVersionStr.."; echo "Copying $BinaryName.app and $UpdateFile to deploy/$AppVersionStrMajor/$AppVersionStr..";
mkdir "$DeployPath" mkdir "$DeployPath"
mkdir "$DeployPath/Telegram" mkdir "$DeployPath/$BinaryName"
cp -r "$ReleasePath/$BinaryName.app" "$DeployPath/Telegram/" cp -r "$ReleasePath/$BinaryName.app" "$DeployPath/$BinaryName/"
if [ "$BetaVersion" != "0" ]; then if [ "$BetaVersion" != "0" ]; then
cd "$DeployPath" && zip -r "$SetupFile" "Telegram" && mv "$SetupFile" "./../../../" && cd "./../../../$HomePath" cd "$DeployPath" && zip -r "$SetupFile" "$BinaryName" && mv "$SetupFile" "./../../../" && cd "./../../../$HomePath"
mv "$ReleasePath/$BetaKeyFile" "$DeployPath/" mv "$ReleasePath/$BetaKeyFile" "$DeployPath/"
fi fi
mv "$ReleasePath/$BinaryName.app.dSYM" "$DeployPath/" mv "$ReleasePath/$BinaryName.app.dSYM" "$DeployPath/"

View file

@ -103,6 +103,12 @@ QAction *PopupMenu::addAction(QAction *a) {
return a; return a;
} }
QAction *PopupMenu::addSeparator() {
QAction *separator = new QAction(this);
separator->setSeparator(true);
return addAction(separator);
}
int32 PopupMenu::processAction(QAction *a, int32 index, int32 w) { int32 PopupMenu::processAction(QAction *a, int32 index, int32 w) {
if (a->isSeparator() || a->text().isEmpty()) { if (a->isSeparator() || a->text().isEmpty()) {
_texts[index] = _shortcutTexts[index] = QString(); _texts[index] = _shortcutTexts[index] = QString();

View file

@ -28,6 +28,7 @@ public:
PopupMenu(QMenu *menu, const style::PopupMenu &st = st::defaultPopupMenu); PopupMenu(QMenu *menu, const style::PopupMenu &st = st::defaultPopupMenu);
QAction *addAction(const QString &text, const QObject *receiver, const char* member); QAction *addAction(const QString &text, const QObject *receiver, const char* member);
QAction *addAction(QAction *a); QAction *addAction(QAction *a);
QAction *addSeparator();
void resetActions(); void resetActions();
typedef QVector<QAction*> Actions; typedef QVector<QAction*> Actions;

View file

@ -827,5 +827,3 @@ outCpp.write('\t}\n}\n');
outCpp.write(textSerializeFull + '\n'); outCpp.write(textSerializeFull + '\n');
print('Done, written {0} constructors, {1} functions.'.format(consts, funcs)); print('Done, written {0} constructors, {1} functions.'.format(consts, funcs));
print('Done, written {0} constructors, {1} functions.'.format(consts, funcs));