Ticket #7495: themepath.diff
File themepath.diff, 4.5 KB (added by , 18 years ago) |
---|
-
gui/options.h
147 147 KeysDialog *_keysDialog; 148 148 #endif 149 149 StaticTextWidget *_savePath; 150 StaticTextWidget *_themePath; 150 151 StaticTextWidget *_extraPath; 151 152 }; 152 153 -
gui/themes/modern.ini
277 277 globaloptions_savebutton=10 yoffset buttonWidth buttonHeight 278 278 globaloptions_savepath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 10) kLineHeight 279 279 yoffset=(yoffset + buttonHeight + 8) 280 globaloptions_themebutton=10 yoffset buttonWidth buttonHeight 281 globaloptions_themepath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 10) kLineHeight 282 yoffset=(yoffset + buttonHeight + 8) 280 283 globaloptions_extrabutton=10 yoffset buttonWidth buttonHeight 281 284 globaloptions_extrapath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 10) kLineHeight 282 285 yoffset=(yoffset + buttonHeight + 12) -
gui/options.cpp
65 65 kSpeechVolumeChanged = 'vcvc', 66 66 kChooseSoundFontCmd = 'chsf', 67 67 kChooseSaveDirCmd = 'chos', 68 kChooseThemeDirCmd = 'chth', 68 69 kChooseExtraDirCmd = 'chex' 69 70 }; 70 71 … … 644 645 new ButtonWidget(tab, "globaloptions_savebutton", "Save Path: ", kChooseSaveDirCmd, 0); 645 646 _savePath = new StaticTextWidget(tab, "globaloptions_savepath", "/foo/bar"); 646 647 648 new ButtonWidget(tab, "globaloptions_themebutton", "Theme Path:", kChooseThemeDirCmd, 0); 649 _themePath = new StaticTextWidget(tab, "globaloptions_themepath", "None"); 650 647 651 new ButtonWidget(tab, "globaloptions_extrabutton", "Extra Path:", kChooseExtraDirCmd, 0); 648 652 _extraPath = new StaticTextWidget(tab, "globaloptions_extrapath", "None"); 649 653 #endif … … 678 682 679 683 #if !( defined(__DC__) || defined(__GP32__) || defined(__PLAYSTATION2__) ) 680 684 // Set _savePath to the current save path 681 Common::String dir(ConfMan.get("savepath", _domain)); 685 Common::String savePath(ConfMan.get("savepath", _domain)); 686 Common::String themePath(ConfMan.get("themepath", _domain)); 682 687 Common::String extraPath(ConfMan.get("extrapath", _domain)); 683 688 684 if (! dir.empty()) {685 _savePath->setLabel( dir);689 if (!savePath.empty()) { 690 _savePath->setLabel(savePath); 686 691 } else { 687 692 // Default to the current directory... 688 693 char buf[MAXPATHLEN]; … … 690 695 _savePath->setLabel(buf); 691 696 } 692 697 698 if (themePath.empty() || !ConfMan.hasKey("themepath", _domain)) { 699 _themePath->setLabel("None"); 700 } else { 701 _themePath->setLabel(themePath); 702 } 703 693 704 if (extraPath.empty() || !ConfMan.hasKey("extrapath", _domain)) { 694 705 _extraPath->setLabel("None"); 695 706 } else { … … 703 714 // Savepath 704 715 ConfMan.set("savepath", _savePath->getLabel(), _domain); 705 716 717 String themePath(_themePath->getLabel()); 718 if (!themePath.empty() && (themePath != "None")) 719 ConfMan.set("themepath", themePath, _domain); 720 706 721 String extraPath(_extraPath->getLabel()); 707 722 if (!extraPath.empty() && (extraPath != "None")) 708 723 ConfMan.set("extrapath", extraPath, _domain); … … 723 738 } 724 739 break; 725 740 } 741 case kChooseThemeDirCmd: { 742 BrowserDialog browser("Select directory for GUI themes", true); 743 if (browser.runModal() > 0) { 744 // User made his choice... 745 FilesystemNode dir(browser.getResult()); 746 _themePath->setLabel(dir.path()); 747 draw(); 748 } 749 break; 750 } 726 751 case kChooseExtraDirCmd: { 727 752 BrowserDialog browser("Select directory for extra files", true); 728 753 if (browser.runModal() > 0) { -
gui/theme-config.cpp
166 166 "globaloptions_savebutton=10 yoffset (buttonWidth + 5) buttonHeight\n" 167 167 "globaloptions_savepath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 15) kLineHeight\n" 168 168 "yoffset=(yoffset + buttonHeight + 4)\n" 169 "globaloptions_themebutton=10 yoffset (buttonWidth + 5) buttonHeight\n" 170 "globaloptions_themepath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 15) kLineHeight\n" 171 "yoffset=(yoffset + buttonHeight + 4)\n" 169 172 "globaloptions_extrabutton=10 yoffset (buttonWidth + 5) buttonHeight\n" 170 173 "globaloptions_extrapath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 15) kLineHeight\n" 171 174 "yoffset=(yoffset + buttonHeight + 4)\n"