• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Moxkiriyaプロジェクト事前開発用の作業部屋


Commit MetaInfo

修订版5a43448089149519d2dea859fcb03abcb6980c2d (tree)
时间2018-10-09 17:49:30
作者Harold_Andoh <andolloyd@gmai...>
CommiterHarold_Andoh

Log Message

[Moxkiriya7]

*
SelectPartyダイアログでCancelした場合、_party.configにゴミデータを挿入するバグを修正
*
ConfigSettingダイアログを強制クローズした場合、ゴミファイルを生成後、NullPointerExceptionで落ちるバグを修正

更改概述

差异

--- a/src/com/wiki/standalone/moxkiriya/Main.java
+++ b/src/com/wiki/standalone/moxkiriya/Main.java
@@ -88,6 +88,11 @@ public class Main extends Application {
8888 } while(closeType != WikiMainWindow.CloseType.EXIT);
8989 } catch(Exception e) {
9090 e.printStackTrace();
91+ } finally {
92+ if(wikiMainWindow_ != null) {
93+ wikiMainWindow_.closeSession();
94+ }
95+ primaryStage_.hide();
9196 }
9297 }
9398
@@ -97,26 +102,29 @@ public class Main extends Application {
97102 */
98103 private WikiMainWindow.CloseType showWikiMainWindow() throws Exception {
99104 WikiMainWindow.CloseType closeType = WikiMainWindow.CloseType.EXIT;
105+ String appRoot = settingManager_.get(SettingManager.SETINGKEY_MOXKIRIYAROOT);
100106
101- String appRoot = settingManager_.get(SettingManager.SETINGKEY_MOXKIRIYAROOT);
102- File wikirootPath = new File(appRoot + "/" + WikiEngine.WIKIROOT_DIRECTORY);
103-
104- if (wikirootPath != null) {
105- wikirootPath.mkdirs();
106-
107- wikiMainWindow_ = new WikiMainWindow(primaryStage_, resources_);
108-
109- /*
110- * wikirootに MainPageを構築する。
111- */
112- wikiMainWindow_.buildWikiMainTree(wikirootPath);
113-
114- /*
115- * 外部リンクアイコン画像をApprootにアップロードする。
116- */
117- wikiMainWindow_.uploadResourcefile(appRoot + "/", "icon/Icon_External_Link.png");
118-
119- closeType = wikiMainWindow_.show();
107+ if(appRoot != null) {
108+ File wikirootPath = new File(appRoot + "/" + WikiEngine.WIKIROOT_DIRECTORY);
109+
110+ if (wikirootPath != null) {
111+ wikirootPath.mkdirs();
112+
113+ wikiMainWindow_ = new WikiMainWindow(primaryStage_, resources_);
114+
115+ /*
116+ * wikirootに MainPageを構築する。
117+ */
118+ wikiMainWindow_.buildWikiMainTree(wikirootPath);
119+
120+ /*
121+ * 外部リンクアイコン画像をApprootにアップロードする。
122+ */
123+ wikiMainWindow_.uploadResourcefile(appRoot + "/icon/Icon_External_Link.png",
124+ "icon/Icon_External_Link.png");
125+
126+ closeType = wikiMainWindow_.show();
127+ }
120128 }
121129
122130 return closeType;
@@ -164,9 +172,15 @@ public class Main extends Application {
164172 Hashtable<String, String> settingsTable = dialog.getSettingsTable();
165173 String path = settingManager_.get(SettingManager.SETTINGSKEY_MOXKIRIYA_USER_DIR);
166174
167- settingManager_.putParty(selectedParty, dialog.getDefaultPartyCheckValue());
168- settingManager_.savePartyConfig(path);
169- settingManager_.saveSettingConfig(path, selectedParty, settingsTable);
170- settingManager_.loadSettingFiles(path);
175+ if(selectedParty.isEmpty() == true) {
176+ selectedParty = dialog.getPartyName();
177+ }
178+
179+ if(selectedParty.isEmpty() != true) {
180+ settingManager_.putParty(selectedParty, dialog.getDefaultPartyCheckValue());
181+ settingManager_.savePartyConfig(path);
182+ settingManager_.saveSettingConfig(path, selectedParty, settingsTable);
183+ settingManager_.loadSettingFiles(path);
184+ }
171185 }
172186 }
--- a/src/com/wiki/standalone/moxkiriya/SettingManager.java
+++ b/src/com/wiki/standalone/moxkiriya/SettingManager.java
@@ -279,14 +279,16 @@ public class SettingManager {
279279 * @param isDefault
280280 */
281281 public void putParty(String partyName, boolean isDefault) {
282- if(isDefault == true) {
283- Set<String> keySet = partyTable_.keySet();
284-
285- for(String key: keySet) {
286- partyTable_.put(key, false);
282+ if(partyName.isEmpty() != true) {
283+ if(isDefault == true) {
284+ Set<String> keySet = partyTable_.keySet();
285+
286+ for(String key: keySet) {
287+ partyTable_.put(key, false);
288+ }
287289 }
290+ partyTable_.put(partyName, isDefault);
288291 }
289- partyTable_.put(partyName, isDefault);
290292 }
291293
292294 /**
--- a/src/com/wiki/standalone/moxkiriya/WikiMainWindowController.java
+++ b/src/com/wiki/standalone/moxkiriya/WikiMainWindowController.java
@@ -399,14 +399,12 @@ public class WikiMainWindowController implements Initializable {
399399 AlertDialog dialog = new AlertDialog(AlertDialog.MessageType.SuccessImport);
400400 dialog.showDialog(stage_, resourceBundle_);
401401 stage_.hide();
402- stage_.getOwner().hide();
403402 } catch (Exception e) {
404403 e.printStackTrace();
405404 try {
406405 AlertDialog dialog = new AlertDialog(AlertDialog.MessageType.FailureImport);
407406 dialog.showDialog(stage_, resourceBundle_);
408407 stage_.hide();
409- stage_.getOwner().hide();
410408 } catch (Exception e1) {
411409 e1.printStackTrace();
412410 }
@@ -452,7 +450,6 @@ public class WikiMainWindowController implements Initializable {
452450 editMode_ = EditMode.NONE;
453451 wikiEngine_.cancelCheckout();
454452 stage_.hide();
455- stage_.getOwner().hide();
456453 }
457454 }
458455 else {