Skip to content

Commit

Permalink
[add] pangu
Browse files Browse the repository at this point in the history
  • Loading branch information
taseikyo committed Jul 10, 2020
1 parent 5be20ce commit 8cb92f0
Show file tree
Hide file tree
Showing 12 changed files with 375 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ All image resources in this repo are from [iconfont](http://www.iconfont.cn).
| ------------------------------ | ------------------------------ | -------------------------------| ------------------------------ | ------------------------------- |
| [Google Translate](#google-translate) | [Bilibili Kit](#bilibili-kit) | [Words Recorder](#words-recorder) | [HUST Electricity Fee](#hust-electricity-fee) | [Missevan Kit](#missevan-kit) |
| [Lossless Music Box](#lossless-music-box) | [HUST Lib](#hust-lib) | [WordCloud Generator](#wordcloud-generator) | [Cat Calendar](#cat-calendar) | [FFmpeg Helper](#ffmpeg-helper) |
| [Pangu](#pangu) | | | | |

### Google Translate
[Google Translate](google-translate) is a translation app using [Google translate api](https://github.com/ssut/py-googletrans).
Expand Down Expand Up @@ -90,6 +91,14 @@ A simple [Cat Calendar](cat-calendar) image generator that uses the "www.dutanga
<img src="images/ffmpeg-helper.gif" alt="FFmpeg Helper" title="FFmpeg Helper" />
</div>

### Pangu

[Pangu](pangu): can't you add spaces?

<div align="center">
<img src="images/pangu.gif" alt="Pangu" title="Pangu" />
</div>

### Donation
If you think these apps are useful, you can buy me a cup of coffee :P
<div>
Expand Down
Binary file added images/pangu.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions pangu/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## 为什么你们就是不能加个空格呢?

自动中英文混排自动加空格

前一个自动指本应用,后一个自动指 [vinta/pangu.py](https://github.com/vinta/pangu.py),避免每次都要手动运行,干脆直接搞一个有界面更友好的工具。

2 changes: 2 additions & 0 deletions pangu/pangu/cat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions pangu/pangu/gen.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pyuic5.exe mwin.ui -o ..\src\mwin.py

pyrcc5.exe res.qrc -o ..\src\res_rc.py
11 changes: 11 additions & 0 deletions pangu/pangu/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "mwin.h"

#include <QApplication>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MWin w;
w.show();
return a.exec();
}
15 changes: 15 additions & 0 deletions pangu/pangu/mwin.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include "mwin.h"
#include "ui_mwin.h"

MWin::MWin(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MWin)
{
ui->setupUi(this);
}

MWin::~MWin()
{
delete ui;
}

21 changes: 21 additions & 0 deletions pangu/pangu/mwin.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#ifndef MWIN_H
#define MWIN_H

#include <QMainWindow>

QT_BEGIN_NAMESPACE
namespace Ui { class MWin; }
QT_END_NAMESPACE

class MWin : public QMainWindow
{
Q_OBJECT

public:
MWin(QWidget *parent = nullptr);
~MWin();

private:
Ui::MWin *ui;
};
#endif // MWIN_H
169 changes: 169 additions & 0 deletions pangu/pangu/mwin.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MWin</class>
<widget class="QMainWindow" name="MWin">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>730</width>
<height>500</height>
</rect>
</property>
<property name="font">
<font>
<family>Microsoft YaHei</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="windowTitle">
<string>Pangu Tools</string>
</property>
<property name="windowIcon">
<iconset resource="res.qrc">
<normaloff>:/images/cat.svg</normaloff>:/images/cat.svg</iconset>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>就不能加个空格呢?</string>
</property>
</widget>
</item>
<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="QCheckBox" name="listen_clip_board">
<property name="font">
<font>
<family>Microsoft YaHei</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>监听剪贴板</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="remove_newline">
<property name="font">
<font>
<family>Microsoft YaHei</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>消除回车</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="replace_symbol">
<property name="text">
<string>中英符号替换</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="pangu_btn">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string>Pangu</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="copy_btn">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string>Copy</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>原文</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QTextEdit" name="before_txt"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>添加空格后</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QTextEdit" name="after_txt"/>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>730</width>
<height>26</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources>
<include location="res.qrc"/>
</resources>
<connections/>
</ui>
34 changes: 34 additions & 0 deletions pangu/pangu/pangu.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++11

# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

SOURCES += \
main.cpp \
mwin.cpp

HEADERS += \
mwin.h

FORMS += \
mwin.ui

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

RESOURCES += \
res.qrc
5 changes: 5 additions & 0 deletions pangu/pangu/res.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/images">
<file>cat.svg</file>
</qresource>
</RCC>
Loading

0 comments on commit 8cb92f0

Please sign in to comment.