Skip to content

Commit

Permalink
Merge pull request #127 from rememberber/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
rememberber authored Dec 7, 2024
2 parents 49fec12 + 12ce96b commit 819d978
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 11 deletions.
8 changes: 4 additions & 4 deletions download_links.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"windows": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.6.5/MooTool-1.6.5-windows.exe",
"mac": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.6.5/MooTool_1.6.5.dmg",
"macSilicon": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.6.5/MooTool_1.6.5-AppleSilicon.dmg",
"linux": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.6.5/MooTool_1.6.5.deb"
"windows": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.6.6/MooTool-1.6.6-windows.exe",
"mac": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.6.6/MooTool_1.6.6.dmg",
"macSilicon": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.6.6/MooTool_1.6.6-AppleSilicon.dmg",
"linux": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.6.6/MooTool_1.6.6.deb"
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.luoboduner.moo.tool</groupId>
<artifactId>MooTool</artifactId>
<version>1.6.5</version>
<version>1.6.6</version>
<packaging>jar</packaging>

<name>MooTool</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ public interface TQuickNoteMapper {
int updateAll(TQuickNote tQuickNote);

List<TQuickNote> selectAllByFilter(String titleFilterKeyWord);

List<TQuickNote> selectAllByFilterContainsContent(String titleFilterKeyWord);
}
2 changes: 1 addition & 1 deletion src/main/java/com/luoboduner/moo/tool/ui/UiConsts.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class UiConsts {
* 软件名称,版本
*/
public static final String APP_NAME = "MooTool";
public static final String APP_VERSION = "v1.6.5";
public static final String APP_VERSION = "v1.6.6";

public static final int TABLE_ROW_HEIGHT = 30;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public class QuickNoteForm {
private JCheckBox commaDoubleQuotesToEnterCheckBox;

private JToggleButton colorButton;
private JCheckBox searchContentCheckBox;

private JToolBar toolBar;
public final static String[] COLOR_KEYS = {
Expand All @@ -122,6 +123,7 @@ private QuickNoteForm() {
colorButton.setEnabled(true);

toolBar = new JToolBar();
searchContentCheckBox = new JCheckBox();
UndoUtil.register(this);
}

Expand Down Expand Up @@ -155,6 +157,9 @@ private static void initUi() {
quickNoteForm.getSearchTextField().putClientProperty(FlatClientProperties.PLACEHOLDER_TEXT, "搜索");
quickNoteForm.getSearchTextField().putClientProperty(FlatClientProperties.TEXT_FIELD_LEADING_ICON,
new FlatSearchIcon());
quickNoteForm.getSearchContentCheckBox().setToolTipText("包含内容");
quickNoteForm.getSearchTextField().putClientProperty(FlatClientProperties.TEXT_FIELD_TRAILING_COMPONENT, quickNoteForm.getSearchContentCheckBox());

quickNoteForm.getAddButton().setIcon(new FlatSVGIcon("icon/add.svg"));
quickNoteForm.getSaveButton().setIcon(new FlatSVGIcon("icon/save.svg"));
quickNoteForm.getFindButton().setIcon(new FlatSVGIcon("icon/find.svg"));
Expand Down Expand Up @@ -363,7 +368,14 @@ public static void initNoteListTable() {

String titleFilterKeyWord = quickNoteForm.getSearchTextField().getText();
titleFilterKeyWord = "%" + titleFilterKeyWord + "%";
List<TQuickNote> quickNoteList = quickNoteMapper.selectAllByFilter(titleFilterKeyWord);
boolean searchContent = quickNoteForm.getSearchContentCheckBox().isSelected();

List<TQuickNote> quickNoteList;
if (searchContent && StringUtils.isNotBlank(titleFilterKeyWord)) {
quickNoteList = quickNoteMapper.selectAllByFilterContainsContent(titleFilterKeyWord);
} else {
quickNoteList = quickNoteMapper.selectAllByFilter(titleFilterKeyWord);
}

for (TQuickNote tQuickNote : quickNoteList) {
data = new Object[2];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private static void initUi() {
translationForm.getSplitPane().setDividerLocation((int) (App.mainFrame.getWidth() / 5));
translationForm.getListTable().setRowHeight(UiConsts.TABLE_ROW_HEIGHT);

translationForm.getTranslationLayoutForm().getSplitPane().setDividerLocation((int) (App.mainFrame.getWidth() / 2));
translationForm.getTranslationLayoutForm().getSplitPane().setDividerLocation((int) (App.mainFrame.getWidth() / 2) - 80);

translationForm.getTranslationPanel().updateUI();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,11 @@ public void changedUpdate(DocumentEvent e) {
// QuickNoteForm.initNoteListTable();
}
});

// 搜索框包含内容checkbox变更事件
quickNoteForm.getSearchContentCheckBox().addActionListener(e -> {
QuickNoteForm.initNoteListTable();
});
}

public static void showFindPanel() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public String translate(String word, String sourceLanguage, String targetLanguag
return "访问Google翻译接口超时:" + e.getMessage();
} catch (Exception e) {
log.error("访问Google翻译异常", e);
return e.getMessage();
return "访问Google翻译接口异常:" + e.getMessage();
}
}

Expand Down
8 changes: 8 additions & 0 deletions src/main/resources/mapper/TQuickNoteMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,14 @@
where name like #{titleFilterKeyWord,jdbcType=VARCHAR}
order by modified_time desc
</select>
<select id="selectAllByFilterContainsContent" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_quick_note
where name like #{titleFilterKeyWord,jdbcType=VARCHAR}
or content like #{contentFilterKeyWord,jdbcType=VARCHAR}
order by modified_time desc
</select>
<update id="updateByName" parameterType="com.luoboduner.moo.tool.domain.TQuickNote">
update t_quick_note
<set>
Expand Down
10 changes: 8 additions & 2 deletions src/main/resources/version_summary.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"currentVersion": "v1.6.5",
"currentVersion": "v1.6.6",
"versionIndex": {
"v0.0.0": "0",
"v1.0.0": "1",
Expand Down Expand Up @@ -36,7 +36,8 @@
"v1.6.2": "32",
"v1.6.3": "33",
"v1.6.4": "34",
"v1.6.5": "35"
"v1.6.5": "35",
"v1.6.6": "36"
},
"versionDetailList": [
{
Expand Down Expand Up @@ -218,6 +219,11 @@
"version": "v1.6.5",
"title": "首次初始化时的细节优化和一些功能更新",
"log": "● 首次初始化时的细节优化\n● 新增快捷键:Command + W 最小化窗口\n● JSON工具增加JavaBean和JSON互转功能\n● 格式化Tab支持文本格式化\n\n"
},
{
"version": "v1.6.6",
"title": "初步支持翻译功能",
"log": "● 初步支持翻译功能\n● HTTP请求无HTTP前缀时默认添加http://前缀 感谢:guozhipeng\n● 二维码保存按钮文案改为:保存\n● About页面增加贡献者列表\n\n"
}
]
}

0 comments on commit 819d978

Please sign in to comment.