Skip to content

Commit

Permalink
对所有输入和显示框右键汉化,及修复在获取公告后点击高级设置或关于仍然存在瞎跳转的BUG.
Browse files Browse the repository at this point in the history
  • Loading branch information
CHN-STUDENT authored Oct 26, 2017
1 parent a2df07b commit 53d5628
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 19 deletions.
12 changes: 11 additions & 1 deletion srun-3k-ui/main.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
#include "mainwindow.h"
#include <QApplication>

#include <QTranslator>
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication a(argc, argv);
//汉化右键菜单,参考http://blog.csdn.net/abcvincent/article/details/71247111?locationNum=16&fps=1
QTranslator translator;
qApp->installTranslator(&translator);
translator.load(":/language/qt_zh_CN.qm");
//添加qt_zh_CN.qm汉化;

QTranslator translator2;
qApp->installTranslator(&translator2);
translator2.load(":/language/widgets.qm");
//添加widgets.qm汉化;
MainWindow w;
w.show();
return a.exec();
Expand Down
33 changes: 19 additions & 14 deletions srun-3k-ui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ void MainWindow::Start(void)
}
else
{//不存在服务器信息文件,要求设置
ui->advanced_save->setGeometry(30,330,290,50);
ui->login_server->setText("http://172.16.154.130");
ui->service_server->setText("http://172.16.154.130");
ui->mac->setText("02:00:00:00:00:00");
Expand Down Expand Up @@ -246,20 +247,23 @@ void MainWindow::AutoJumpTimeSlot()
AutoJumpTimer->stop();
disconnect(AutoJumpTimer, SIGNAL(timeout()), this, SLOT(AutoJumpTimeSlot()));
AutoJumpTimer->deleteLater();
if(state==0)
{
ui->stackedWidget->setCurrentIndex(2);
ui->LoginButton->setEnabled(true);
if(ui->AUTO_LOGIN->isChecked())
{
QTimer::singleShot(3000,[this](){ui->LoginButton->click();});
}
}
else if(state==1)
{
ui->stackedWidget->setCurrentIndex(3);
ui->LogoutButton->setEnabled(true);
}
if(ui->stackedWidget->currentIndex()==1)
{//如果自动跳转发现仍然停留在获取公告页面
if(state==0)
{
ui->stackedWidget->setCurrentIndex(2);
ui->LoginButton->setEnabled(true);
if(ui->AUTO_LOGIN->isChecked())
{
QTimer::singleShot(3000,[this](){ui->LoginButton->click();});
}
}
else if(state==1)
{
ui->stackedWidget->setCurrentIndex(3);
ui->LogoutButton->setEnabled(true);
}
}
}


Expand Down Expand Up @@ -752,6 +756,7 @@ void MainWindow::on_advanced_save_clicked()
ui->stackedWidget->setCurrentIndex(1);
ui->Message_show->setText("请等待程序重新获取公告!");
ui->advanced_back->show();
ui->advanced_save->setGeometry(30,330,170,50);
QTimer::singleShot(2000, this, SLOT(GetServerInfo()));
}

Expand Down
8 changes: 6 additions & 2 deletions srun-3k-ui/mainwindow.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
<file alias="advanced_pressed">Resouces/titleButtons/advanced_pressed.png</file>
</qresource>
<qresource prefix="/Ico">
<file alias="R">Resouces/Ico/myapp(RGB).png</file>
<file alias="R">Resouces/Ico/new.png</file>
<file alias="SysIcon">Resouces/Ico/myappSysTrayIcon.png</file>
</qresource>
</RCC>
<qresource prefix="/language">
<file alias="widgets.qm">Resouces/language/widgets.qm</file>
<file alias="qt_zh_CN.qm">Resouces/language/qt_zh_CN.qm</file>
</qresource>
</RCC>
6 changes: 4 additions & 2 deletions srun-3k-ui/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ background:#127e10;
<rect>
<x>30</x>
<y>330</y>
<width>171</width>
<width>170</width>
<height>50</height>
</rect>
</property>
Expand Down Expand Up @@ -1097,7 +1097,7 @@ border: 1px solid #D9D9D6;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'SimSun'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;校园网登录器 V1.02.1&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;校园网登录器 V1.02.2&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;By CHN-STUDENT&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Copyright(C) 2017&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;-----------------------&lt;/p&gt;
Expand All @@ -1119,6 +1119,8 @@ p, li { white-space: pre-wrap; }
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;3.其他问题。&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;-----------------------&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;V1.02.2对所有输入和显示框右键汉化,及修复在获取公告后点击高级设置或关于仍然存在瞎跳转的BUG.&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;V1.02.1修复因判断错误造成无法存储个人信息的BUG。&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;已经在V1.02修复时间问题,感谢 Chloe ,Noisky 和 MouYouLing。&lt;/p&gt;
Expand Down

0 comments on commit 53d5628

Please sign in to comment.