Skip to content

Commit

Permalink
Look&Feel options dialog
Browse files Browse the repository at this point in the history
git-svn-id: https://only.mawhrin.net/repos/stuff/trunk@4555 62a0de91-87f2-0310-aeaa-8eaa5733e38e
  • Loading branch information
vasiliy-bout committed Sep 21, 2010
1 parent 3cee65a commit a1f973b
Show file tree
Hide file tree
Showing 18 changed files with 58 additions and 57 deletions.
4 changes: 2 additions & 2 deletions fbreader/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ include $(MAKEFILESDIR)/config.mk
TARGET = FBReader
target = fbreader

ALL_SUBDIRS = src src/database src/database/sqldb src/database/sqldb/implsqlite src/database/booksdb src/database/booksdb/runnables src/migration src/options src/library src/bookmodel src/formats src/formats/fb2 src/formats/docbook src/formats/css src/formats/html src/formats/pdb src/formats/txt src/formats/tcr src/formats/chm src/formats/xhtml src/formats/oeb src/formats/rtf src/formats/openreader src/formats/pdf src/formats/dummy src/formats/util src/external src/fbreader src/encodingOption src/network src/network/authentication src/network/authentication/basic src/network/atom src/network/opds src/network/authentication/litres src/blockTree src/libraryActions src/libraryTree src/networkActions src/networkTree src/optionsDialog src/optionsDialog/bookInfo src/optionsDialog/library src/optionsDialog/network src/optionsDialog/system src/optionsDialog/reading
ALL_SUBDIRS = src src/database src/database/sqldb src/database/sqldb/implsqlite src/database/booksdb src/database/booksdb/runnables src/migration src/options src/library src/bookmodel src/formats src/formats/fb2 src/formats/docbook src/formats/css src/formats/html src/formats/pdb src/formats/txt src/formats/tcr src/formats/chm src/formats/xhtml src/formats/oeb src/formats/rtf src/formats/openreader src/formats/pdf src/formats/dummy src/formats/util src/external src/fbreader src/encodingOption src/network src/network/authentication src/network/authentication/basic src/network/atom src/network/opds src/network/authentication/litres src/blockTree src/libraryActions src/libraryTree src/networkActions src/networkTree src/optionsDialog src/optionsDialog/bookInfo src/optionsDialog/library src/optionsDialog/network src/optionsDialog/system src/optionsDialog/reading src/optionsDialog/lookAndFeel
ALL_ARCHSUBDIRS = desktop pdaxrom opie zaurus maemo openzaurus pma400 win32

SUBDIRS = src/database src/database/sqldb src/database/sqldb/implsqlite src/database/booksdb src/database/booksdb/runnables src/migration src/options src/library src/bookmodel \
src/formats src/formats/fb2 src/formats/css src/formats/html src/formats/pdb src/formats/txt src/formats/tcr src/formats/chm src/formats/xhtml src/formats/oeb src/formats/rtf src/formats/openreader src/formats/util \
src/external src/fbreader src/encodingOption src/network src/network/authentication src/network/authentication/basic src/network/atom src/network/opds src/network/authentication/litres \
src/blockTree src/libraryActions src/libraryTree src/networkActions src/networkTree src/optionsDialog src/optionsDialog/bookInfo src/optionsDialog/library src/optionsDialog/network src/optionsDialog/system src/optionsDialog/reading
src/blockTree src/libraryActions src/libraryTree src/networkActions src/networkTree src/optionsDialog src/optionsDialog/bookInfo src/optionsDialog/library src/optionsDialog/network src/optionsDialog/system src/optionsDialog/reading src/optionsDialog/lookAndFeel

all: .resources
@for subdir in $(SUBDIRS); do \
Expand Down
24 changes: 14 additions & 10 deletions fbreader/data/resources/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,6 @@
<node name="label" value="Previous" />
<node name="tooltip" value="Find Previous" />
</node>
<node name="bookInfo">
<node name="label" value="Book Info" />
<node name="tooltip" value="Show Book Info Dialog" />
</node>
<node name="preferences">
<node name="label" value="Preferences" />
<node name="tooltip" value="Show Preferences Dialog" />
</node>
<node name="rotate">
<node name="label" value="Rotate" />
<node name="tooltip" value="Rotate Text" />
Expand All @@ -204,6 +196,14 @@
<node name="label" value="Filter" />
<node name="tooltip" value="Filter" />
</node>
<node name="preferences">
<node name="label" value="Preferences" />
<node name="tooltip" value="Show Preferences Dialog" />
</node>
<node name="bookInfo">
<node name="label" value="Book Info" />
<node name="tooltip" value="Show Book Info Dialog" />
</node>
<node name="libraryOptions">
<node name="label" value="Library Preferences" />
<node name="tooltip" value="Show Library Preferences Dialog" />
Expand All @@ -220,6 +220,10 @@
<node name="label" value="Reading Preferences" />
<node name="tooltip" value="Show Reading Preferences Dialog" />
</node>
<node name="lookAndFeelOptions">
<node name="label" value="Look &amp; Feel Preferences" />
<node name="tooltip" value="Show Look &amp; Feel Preferences Dialog" />
</node>
</node>
<node name="dialog">
<node name="button">
Expand Down Expand Up @@ -372,8 +376,8 @@
</node>
</node>
</node>
<node name="OptionsDialog">
<node name="title" value="FBReader - Options" />
<node name="LookAndFeelOptionsDialog">
<node name="title" value="FBReader - Look &amp; Feel Options" />
<node name="tab">
<node name="CSS" value="CSS">
<node name="overrideSpecifiedFonts" value="Always Use My Own Fonts" />
Expand Down
1 change: 1 addition & 0 deletions fbreader/src/fbreader/FBReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ FBReader::FBReader(const std::string &bookToOpen) :
addAction(ActionCode::SHOW_NETWORK_OPTIONS_DIALOG, new ShowNetworkOptionsDialogAction());
addAction(ActionCode::SHOW_SYSTEM_OPTIONS_DIALOG, new ShowSystemOptionsDialogAction());
addAction(ActionCode::SHOW_READING_OPTIONS_DIALOG, new ShowReadingOptionsDialogAction());
addAction(ActionCode::SHOW_LOOKANDFEEL_OPTIONS_DIALOG, new ShowLookAndFeelOptionsDialogAction());
addAction(ActionCode::ADD_BOOK, new AddBookAction(FBReader::BOOK_TEXT_MODE | FBReader::LIBRARY_MODE | FBReader::CONTENTS_MODE));
addAction(ActionCode::UNDO, new UndoAction(FBReader::BOOK_TEXT_MODE));
addAction(ActionCode::REDO, new RedoAction());
Expand Down
1 change: 1 addition & 0 deletions fbreader/src/fbreader/FBReaderActionCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const std::string ActionCode::SHOW_LIBRARY_OPTIONS_DIALOG = "libraryOptions";
const std::string ActionCode::SHOW_NETWORK_OPTIONS_DIALOG = "networkOptions";
const std::string ActionCode::SHOW_SYSTEM_OPTIONS_DIALOG = "systemOptions";
const std::string ActionCode::SHOW_READING_OPTIONS_DIALOG = "readingOptions";
const std::string ActionCode::SHOW_LOOKANDFEEL_OPTIONS_DIALOG = "lookAndFeelOptions";
const std::string ActionCode::UNDO = "undo";
const std::string ActionCode::REDO = "redo";
const std::string ActionCode::SEARCH = "search";
Expand Down
10 changes: 7 additions & 3 deletions fbreader/src/fbreader/FBReaderActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
#include "FBReaderActions.h"
#include "BookTextView.h"
#include "ContentsView.h"
#include "../optionsDialog/OptionsPage.h"
#include "../optionsDialog/OptionsDialog.h"
#include "../optionsDialog/bookInfo/BookInfoDialog.h"
#include "../optionsDialog/library/LibraryOptionsDialog.h"
#include "../optionsDialog/network/NetworkOptionsDialog.h"
#include "../optionsDialog/system/SystemOptionsDialog.h"
#include "../optionsDialog/reading/ReadingOptionsDialog.h"
#include "../optionsDialog/lookAndFeel/OptionsPage.h"
#include "../optionsDialog/lookAndFeel/LookAndFeelOptionsDialog.h"

#include "../bookmodel/BookModel.h"
#include "../options/FBTextStyle.h"
Expand Down Expand Up @@ -80,7 +80,7 @@ void ShowHelpAction::run() {
}

void ShowOptionsDialogAction::run() {
OptionsDialog().dialog().run();
// TODO: implement
}

void ShowLibraryOptionsDialogAction::run() {
Expand All @@ -99,6 +99,10 @@ void ShowReadingOptionsDialogAction::run() {
ReadingOptionsDialog().dialog().run();
}

void ShowLookAndFeelOptionsDialogAction::run() {
LookAndFeelOptionsDialog().dialog().run();
}

ShowContentsAction::ShowContentsAction() : SetModeAction(FBReader::CONTENTS_MODE, FBReader::BOOK_TEXT_MODE) {
}

Expand Down
7 changes: 7 additions & 0 deletions fbreader/src/fbreader/FBReaderActions.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class ActionCode {
static const std::string SHOW_NETWORK_OPTIONS_DIALOG;
static const std::string SHOW_SYSTEM_OPTIONS_DIALOG;
static const std::string SHOW_READING_OPTIONS_DIALOG;
static const std::string SHOW_LOOKANDFEEL_OPTIONS_DIALOG;
static const std::string UNDO;
static const std::string REDO;
static const std::string SEARCH;
Expand Down Expand Up @@ -142,6 +143,12 @@ class ShowReadingOptionsDialogAction : public ZLApplication::Action {
void run();
};

class ShowLookAndFeelOptionsDialogAction : public ZLApplication::Action {

public:
void run();
};

class ShowContentsAction : public SetModeAction {

public:
Expand Down
1 change: 1 addition & 0 deletions fbreader/src/fbreader/PreferencesPopupData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
PreferencesPopupData::PreferencesPopupData() {
myActionIds.push_back(ActionCode::SHOW_BOOK_INFO_DIALOG);
myActionIds.push_back(ActionCode::SHOW_READING_OPTIONS_DIALOG);
myActionIds.push_back(ActionCode::SHOW_LOOKANDFEEL_OPTIONS_DIALOG);
myActionIds.push_back(ActionCode::SHOW_LIBRARY_OPTIONS_DIALOG);
myActionIds.push_back(ActionCode::SHOW_NETWORK_OPTIONS_DIALOG);
myActionIds.push_back(ActionCode::SHOW_SYSTEM_OPTIONS_DIALOG);
Expand Down
8 changes: 5 additions & 3 deletions fbreader/src/optionsDialog/IntegrationTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@

#include <ZLOptionsDialog.h>
#include <ZLOptionEntry.h>
#include <ZLStringUtil.h>

#include <optionEntries/ZLToggleBooleanOptionEntry.h>
#include <optionEntries/ZLSimpleOptionEntry.h>
#include <ZLStringUtil.h>

#include "OptionsDialog.h"
#include "../options/FBCategoryKey.h"
#include "AbstractOptionsDialog.h"

#include "../options/FBCategoryKey.h"
#include "../external/ProgramCollection.h"


class ProgramChoiceEntry : public ZLComboOptionEntry {

public:
Expand Down
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

#include "FormatOptionsPage.h"

#include "../options/FBTextStyle.h"
#include "../bookmodel/FBTextKind.h"
#include "../../options/FBTextStyle.h"
#include "../../bookmodel/FBTextKind.h"

static const ZLResourceKey KEY_STYLE("style");
static const ZLResourceKey KEY_BASE("Base");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2010 Geometer Plus <contact@geometerplus.com>
* Copyright (C) 2010 Geometer Plus <contact@geometerplus.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -20,43 +20,32 @@
#include <ZLDialogManager.h>
#include <ZLOptionsDialog.h>
#include <ZLPaintContext.h>
#include <ZLEncodingConverter.h>

#include <optionEntries/ZLColorOptionBuilder.h>
#include <optionEntries/ZLSimpleOptionEntry.h>
#include <optionEntries/ZLToggleBooleanOptionEntry.h>
#include <optionEntries/ZLColorOptionBuilder.h>

#include <ZLTextView.h>
#include <ZLTextStyle.h>
#include <ZLTextStyleCollection.h>
#include <ZLTextStyleOptions.h>

#include "OptionsDialog.h"
#include "LookAndFeelOptionsDialog.h"

#include "FormatOptionsPage.h"
#include "StyleOptionsPage.h"
#include "NetworkLibraryPage.h"

#include "../fbreader/FBReader.h"
#include "../options/FBOptions.h"
#include "../fbreader/BookTextView.h"

#include "../network/NetworkLinkCollection.h"
#include "../library/Library.h"
#include "../external/ProgramCollection.h"
#include "../formats/FormatPlugin.h"
#include "../../fbreader/FBReader.h"
#include "../../fbreader/FBView.h"
#include "../../options/FBOptions.h"



OptionsDialog::OptionsDialog() : AbstractOptionsDialog(ZLResourceKey("OptionsDialog"), true) {
LookAndFeelOptionsDialog::LookAndFeelOptionsDialog() : AbstractOptionsDialog(ZLResourceKey("LookAndFeelOptionsDialog"), true) {
FBReader &fbreader = FBReader::Instance();
FBOptions &options = FBOptions::Instance();

ZLOptionsDialog &dialog = this->dialog();

ZLDialogContent &cssTab = dialog.createTab(ZLResourceKey("CSS"));
cssTab.addOption(ZLResourceKey("overrideSpecifiedFonts"), ZLTextStyleCollection::Instance().OverrideSpecifiedFontsOption);

ZLDialogContent &marginTab = dialog.createTab(ZLResourceKey("Margins"));
FBOptions &options = FBOptions::Instance();
marginTab.addOptions(
ZLResourceKey("left"), new ZLSimpleSpinOptionEntry(options.LeftMarginOption, 1),
ZLResourceKey("right"), new ZLSimpleSpinOptionEntry(options.RightMarginOption, 1)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2010 Geometer Plus <contact@geometerplus.com>
* Copyright (C) 2010 Geometer Plus <contact@geometerplus.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -17,30 +17,22 @@
* 02110-1301, USA.
*/

#ifndef __OPTIONSDIALOG_H__
#define __OPTIONSDIALOG_H__
#ifndef __LOOKANDFEELOPTIONSDIALOG_H__
#define __LOOKANDFEELOPTIONSDIALOG_H__

#include "AbstractOptionsDialog.h"
#include "../AbstractOptionsDialog.h"

class ZLOptionsDialog;
class ZLDialogContent;
class OptionsPage;
class NetworkLibraryPage;
class ZLPaintContext;
class ProgramCollection;

class ZLBooleanOptionEntry;
class ZLSpinOptionEntry;
class ZLOption;

class OptionsDialog : public AbstractOptionsDialog {
class LookAndFeelOptionsDialog : public AbstractOptionsDialog {

public:
OptionsDialog();
LookAndFeelOptionsDialog();

private:
shared_ptr<OptionsPage> myFormatPage;
shared_ptr<OptionsPage> myStylePage;
};

#endif /* __OPTIONSDIALOG_H__ */
#endif /* __LOOKANDFEELOPTIONSDIALOG_H__ */
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

#include "StyleOptionsPage.h"

#include "../options/FBTextStyle.h"
#include "../bookmodel/FBTextKind.h"
#include "../../options/FBTextStyle.h"
#include "../../bookmodel/FBTextKind.h"

static const ZLResourceKey KEY_STYLE("style");
static const ZLResourceKey KEY_BASE("Base");
Expand Down

0 comments on commit a1f973b

Please sign in to comment.