Skip to content

Commit

Permalink
Merge branch 'Develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Feb 21, 2019
2 parents 3ba283b + b091278 commit 4ee271a
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 137 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,4 @@ ENDIF(WIN32)
#SET(CMAKE_INSTALL_RPATH ".") #设置链接库的搜索路径

#安装4:安装相关文件
install(FILES License.md Authors.txt ChangeLog.md DESTINATION .)
install(FILES License.md Authors.txt ChangeLog.md AppIcon.ico DESTINATION .)
46 changes: 24 additions & 22 deletions Install/Install.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
!define PRODUCT_NAME "RabbitIM"
!define PRODUCT_VERSION "v0.1.0-312-gbbf45f4"
!define PRODUCT_PUBLISHER "KangLin studio"
!define PRODUCT_WEB_SITE "https://github.com/KangLin/RabbitIM"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\RabbitIM.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\RabbitIM"
!define PRODUCT_WEB_SITE "https://github.com/KangLin/${PRODUCT_NAME}"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${PRODUCT_NAME}.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"

SetCompressor lzma
Expand Down Expand Up @@ -36,7 +36,10 @@ SetCompressor lzma
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!define MUI_FINISHPAGE_RUN "$INSTDIR\RabbitIM.exe"
!define MUI_FINISHPAGE_RUN "$INSTDIR\${PRODUCT_NAME}.exe"
!define MUI_FINISHPAGE_SHOWREADME
!define MUI_FINISHPAGE_SHOWREADME_Function AutoBoot
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Start from boot"
!insertmacro MUI_PAGE_FINISH

; Uninstaller pages
Expand All @@ -50,15 +53,19 @@ LangString LANG_PRODUCT_NAME ${LANG_ENGLISH} "RabbitIM"
LangString LANG_PRODUCT_NAME ${LANG_SIMPCHINESE} "玉兔即时通讯系统"

LangString LANG_UNINSTALL_CONFIRM ${LANG_ENGLISH} "Thank you very much! $(^Name) has been successfully removed."
LangString LANG_UNINSTALL_CONFIRM ${LANG_SIMPCHINESE} "非常感謝您的使用! $(^Name) 已成功地从您的计算机中移除。"
LangString LANG_UNINSTALL_CONFIRM ${LANG_SIMPCHINESE} "非常感谢您的使用! $(^Name) 已成功地从您的计算机中移除。"

LangString LANG_REMOVE_COMPONENT ${LANG_ENGLISH} "You sure you want to completely remove $ (^ Name), and all of its components?"
LangString LANG_REMOVE_COMPONENT ${LANG_SIMPCHINESE} "你确实要完全移除 $(^Name) ,其及所有的组件?"

LangString LANG_AUTO_BOOT ${LANG_ENGLISH} "Start from reboot"
LangString LANG_AUTO_BOOT ${LANG_SIMPCHINESE} "开机自启动"

; MUI end ------

Name "$(LANG_PRODUCT_NAME) ${PRODUCT_VERSION}"
OutFile "RabbitIM-Setup-${PRODUCT_VERSION}.exe"
Name "$(LANG_PRODUCT_NAME)-${PRODUCT_VERSION}"
Caption "$(LANG_PRODUCT_NAME)-${PRODUCT_VERSION}"
OutFile "${PRODUCT_NAME}-Setup-${PRODUCT_VERSION}.exe"
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
Expand Down Expand Up @@ -110,16 +117,8 @@ Function InstallRuntime
${EndIf}
FunctionEnd

Function InstallFont
StrCmp $LANGUAGE "2052" 0 +3
;Modify environment variable for default font to simsun.ttc
WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "OSGEARTH_DEFAULT_FONT" "simsun.ttc"
;Reflash environment variable
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment"
FunctionEnd

Function .onInit
; !insertmacro MUI_LANGDLL_DISPLAY
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd

Section "${PRODUCT_NAME}" SEC01
Expand All @@ -128,9 +127,9 @@ Section "${PRODUCT_NAME}" SEC01
File /r "install\*"
SetShellVarContext all
CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" "$INSTDIR\RabbitIM.exe"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\$(LANG_PRODUCT_NAME).lnk" "$INSTDIR\${PRODUCT_NAME}.exe"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\uninst.exe"
CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\RabbitIM.exe"
CreateShortCut "$DESKTOP\$(LANG_PRODUCT_NAME).lnk" "$INSTDIR\${PRODUCT_NAME}.exe"
SetShellVarContext current
call InstallRuntime
SectionEnd
Expand All @@ -145,11 +144,10 @@ SectionEnd

Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\RabbitIM.exe"
call InstallFont
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\${PRODUCT_NAME}.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\RabbitIM.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\${PRODUCT_NAME}.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
Expand All @@ -171,6 +169,10 @@ Function un.onInit
Abort
FunctionEnd

Function AutoBoot
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\RunOnce" "${PRODUCT_NAME}" "$INSTDIR\${PRODUCT_NAME}.exe"
FunctionEnd

Section Uninstall
SetShellVarContext all
RMDir /r "$SMPROGRAMS\${PRODUCT_NAME}"
Expand All @@ -181,7 +183,7 @@ Section Uninstall

DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
DeleteRegValue HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "OSGEARTH_DEFAULT_FONT"
DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\RunOnce" "${PRODUCT_NAME}"
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment"
SetAutoClose true
SectionEnd
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,10 @@ windows当前分支:[![Build Status](https://ci.appveyor.com/api/projects/status

### 资金捐赠:
* 大于20元的捐赠,请扫描下面二维码:
![支付宝收款(大于20元)](Resource/png/zhifubao.png "支付宝收款(大于20元)")
![微信收款(大于20元)](Resource/png/weixinpay.png "微信收款(大于20元)")
![捐赠(大于20元)](Resource/png/Contribute.png "捐赠(大于20元)")

* 捐赠20元:
![支付宝收款](Resource/png/zhifubao20.png "支付宝收款")
![微信收款](Resource/png/weixinpay20.png "微信收款")
![捐赠20元](Resource/png/Contribute20.png "捐赠20元")

有偿服务:
--------
Expand Down
2 changes: 1 addition & 1 deletion RabbitImApp.pro
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ isEmpty(PREFIX) {
PREFIX = $$OUT_PWD/install
}
}
other.files = License.md Authors.txt ChangeLog.md
other.files = License.md Authors.txt ChangeLog.md AppIcon.ico
other.path = $$PREFIX
other.CONFIG += directory no_check_exist
target.path = $$PREFIX
Expand Down
2 changes: 2 additions & 0 deletions Resource/Resource.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
<file alias="Application">png/Application.png</file>
<file alias="Scan">png/scan.png</file>
<file alias="Browse">png/browse32.png</file>
<file alias="Contribute">png/Contribute.png</file>
<file alias="Contribute20">png/Contribute20.png</file>
</qresource>
<qresource prefix="/sink">
<file alias="Blue">sink/blue.qss</file>
Expand Down
Binary file added Resource/png/Contribute.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resource/png/Contribute20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion Widgets/DlgAbout/DlgAbout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ CDlgAbout::CDlgAbout(QWidget *parent) :
if(m_Image.isNull()) {
ui->lbQrCodePrompt->setVisible(false);
ui->lbQrencode->setVisible(false);
ui->pbSave->setVisible(false);
} else {
ui->lbQrencode->setPixmap(QPixmap::fromImage(m_Image));
}
Expand Down
2 changes: 1 addition & 1 deletion Widgets/DlgAbout/DlgAbout.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CDlgAbout : public QDialog
explicit CDlgAbout(QWidget *parent = 0);
~CDlgAbout();

private slots:
private Q_SLOTS:
void on_pbSave_clicked();

private:
Expand Down
151 changes: 46 additions & 105 deletions Widgets/DlgAbout/DlgAbout.ui
Original file line number Diff line number Diff line change
Expand Up @@ -182,68 +182,34 @@
<string>Informatioin</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_5">
<item row="5" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pbSave">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Save As</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
<item row="2" column="0">
<widget class="QLabel" name="lbHome">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Home page:https://github.com/KangLin/rabbitim</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="lbQrencode">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
Expand All @@ -256,15 +222,15 @@
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>180</height>
<width>9999999</width>
<height>9999999</height>
</size>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="pixmap">
<pixmap resource="../../Resource/Resource.qrc">:/icon/AppIcon</pixmap>
<pixmap resource="../../Resource/Resource.qrc">:/icon/Contribute</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
Expand All @@ -274,31 +240,21 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lbDate">
<item row="0" column="0">
<widget class="QLabel" name="lbVersion">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Build Date:</string>
<string>Version: 1.0.0.0</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
Expand All @@ -308,64 +264,49 @@
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="lbQrCodePrompt">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>The following two-dimensional code scanning Go Home:</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<item row="5" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lbHome">
<item row="1" column="0">
<widget class="QLabel" name="lbDate">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Home page:https://github.com/KangLin/rabbitim</string>
<string>Build Date:</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lbVersion">
<item row="3" column="0">
<widget class="QLabel" name="lbQrCodePrompt">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Version: 1.0.0.0</string>
<property name="font">
<font>
<pointsize>18</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
<property name="text">
<string>Contribute</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
Expand Down
Loading

0 comments on commit 4ee271a

Please sign in to comment.