aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
-rw-r--r--Kconfig21
-rw-r--r--doc/Building.asciidoc33
-rw-r--r--lib/configuration/Kconfig129
-rw-r--r--lib/configuration/configuration.cpp60
-rw-r--r--linux/.config73
-rw-r--r--linux/makepkg/PKGBUILD19
m---------tools/Kconfiglib0
-rwxr-xr-xtools/config.py90
-rw-r--r--windows/.config80
10 files changed, 299 insertions, 209 deletions
diff --git a/.gitmodules b/.gitmodules
index 20e9639..1c11e7c 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,3 @@
[submodule "3rd-party/SingleApplication/SingleApplication.git"]
path = 3rd-party/SingleApplication/SingleApplication.git
url = https://github.com/itay-grudev/SingleApplication.git
-[submodule "tools/Kconfiglib"]
- path = tools/Kconfiglib
- url = https://github.com/ulfalizer/Kconfiglib.git
diff --git a/Kconfig b/Kconfig
index 6682b45..a2578ec 100644
--- a/Kconfig
+++ b/Kconfig
@@ -7,26 +7,7 @@ menu "Application"
default ":/icons/poi.svg"
endmenu
-menu "Configuration defaults"
- config PATH_CONFIG
- string "Configuration location"
- default "~/.config/smolbote/smolbote.cfg"
- config PATH_FILTER
- string "Host filter path"
- default "~/.config/smolbote/hosts.d"
- config PATH_PLUGINS
- string "Plugin load location"
- default "~/.config/smolbote/plugins.d"
- config PATH_PROFILES
- string "Profile load location"
- default "~/.config/smolbote/profiles.d"
- config PATH_BOOKMARKS
- string "Bookmarks location"
- default "~/.config/smolbote/bookmarks.xbel"
- config PATH_DOWNLOADS
- string "Downloads location"
- default "~/Downloads"
-endmenu
+source lib/configuration/Kconfig
config USEPLASMA
bool "Enable KDE Frameworks integration"
diff --git a/doc/Building.asciidoc b/doc/Building.asciidoc
index f1927de..fc7cc89 100644
--- a/doc/Building.asciidoc
+++ b/doc/Building.asciidoc
@@ -15,15 +15,11 @@
| link:https://mesonbuild.com/[meson]
| Version 0.48
-|
+| Requires python3 and ninja
-| ninja
-|
-| Requirement of meson
-
-| python3
-|
-| Requirement both of meson, and some scripts in tools/
+| link:https://github.com/ulfalizer/Kconfiglib[Kconfiglib]
+| Version 10.22.1
+| Available on PyPI with 'pip install kconfiglib'
| A compiler
| C++17 support
@@ -36,9 +32,6 @@
|===
== Building from source
-In short, the generic cmake build loop of 'cmake, make, make install' will
-generate a makefile, build the program and install it.
-
[source, sh]
----
# clone the repository
@@ -58,23 +51,17 @@ meson build
ninja
----
+Run `meson configure` in the build directory to list available options.
+For more information on how to use meson, see the meson link:https://mesonbuild.com/Quick-guide.html[quick guide].
+
=== Configuring smolbote
smolbote uses Kconfig to store and customize default application settings such
-as keyboard shortcuts and paths. You can edit these settings by running
-`tools/Kconfiglib/menuconfig.py` in the repository root.
+as keyboard shortcuts and paths. You can edit these settings using 'menuconfig'
+in the repository root.
-When building, tools/config.py is used to load `platform-name/.config` and
+When building, tools/config.py is used to load `$platform-name/.config` and
generate a header file.
-=== Configuring meson
-Run `meson configure` in the build directory to list available options.
-
-Use `meson configure -Doption=value` change them. Ninja will regenerate its
-build file on next run.
-
-See the link:https://mesonbuild.com/Quick-guide.html[meson documentation] for
-more information on how to use meson.
-
// Compiling on Windows
include::Building/Windows.asciidoc[]
diff --git a/lib/configuration/Kconfig b/lib/configuration/Kconfig
new file mode 100644
index 0000000..3e77434
--- /dev/null
+++ b/lib/configuration/Kconfig
@@ -0,0 +1,129 @@
+
+menu "Configuration defaults"
+ config PATH_CONFIG
+ string "Configuration location"
+ default "~/.config/smolbote/smolbote.cfg"
+ config PATH_FILTER
+ string "Host filter path"
+ default "~/.config/smolbote/hosts.d"
+ config PATH_PLUGINS
+ string "Plugin load location"
+ default "~/.config/smolbote/plugins.d"
+ config PATH_PROFILES
+ string "Profile load location"
+ default "~/.config/smolbote/profiles.d"
+ config PATH_BOOKMARKS
+ string "Bookmarks location"
+ default "~/.config/smolbote/bookmarks.xbel"
+ config PATH_DOWNLOADS
+ string "Downloads location"
+ default "~/Downloads"
+endmenu
+
+menu "Keyboard shortcuts"
+ comment "Main Window shortcuts"
+ config SHORTCUT_WINDOW_NEWGROUP
+ string "New Group shortcut"
+ default "Ctrl+G"
+ config SHORTCUT_WINDOW_NEWWINDOW
+ string "New Window shortcut"
+ default "Ctrl+N"
+ config SHORTCUT_WINDOW_ABOUT
+ string "Show About Dialog"
+ default "Ctrl+H"
+ config SHORTCUT_WINDOW_QUIT
+ string "Quit shortcut"
+ default "Ctrl+Q"
+
+ config SHORTCUT_WINDOW_SEARCH
+ string "Show or hide search box"
+ default "F3"
+
+ config SHORTCUT_WINDOW_BOOKMARKS
+ string "Show bookmarks dialog in this window"
+ default "Ctrl+B"
+ config SHORTCUT_WINDOW_DOWNLOADS
+ string "Show downloads dialog in this window"
+ default "Ctrl+D"
+
+ comment "Navigation Bar shortcuts"
+ config SHORTCUT_NAVIGATION_BACK
+ string "Go back in history"
+ default "Ctrl+Left"
+ config SHORTCUT_NAVIGATION_BACKMENU
+ string "Show Back history menu"
+ default "Ctrl+Down"
+ config SHORTCUT_NAVIGATION_FORWARD
+ string "Go forward in history"
+ default "Ctrl+Right"
+ config SHORTCUT_NAVIGATION_FORWARDMENU
+ string "Show Forward history menu"
+ default "Ctrl+Up"
+ config SHORTCUT_NAVIGATION_REFRESH
+ string "Refresh the page"
+ default "F5"
+ config SHORTCUT_NAVIGATION_RELOAD
+ string "Reload the page"
+ default "Ctrl+F5"
+ config SHORTCUT_NAVIGATION_HOME
+ string "Load homepage"
+ default "Ctrl+Home"
+
+ comment "Address Bar shortcuts"
+ config SHORTCUT_ADDRESS_FOCUS
+ string "Focus the Address Bar"
+ default "F4"
+ config SHORTCUT_ADDRESS_MENU
+ string "Show Address Bar menu"
+ default "F2"
+
+ comment "Subwindow shortcuts"
+ config SHORTCUT_SUBWINDOW_MENU
+ string "Subwindow context menu"
+ default "F1"
+ config SHORTCUT_SUBWINDOW_TILE
+ string "Tile subwindows"
+ default "F9"
+ config SHORTCUT_SUBWINDOW_CASCADE
+ string "Cascade subwindow"
+ default "F10"
+ config SHORTCUT_SUBWINDOW_FULLSCREEN
+ string "Make current subwindow fullscreen"
+ default "F11"
+
+ config SHORTCUT_SUBWINDOW_NEWTAB
+ string "Create new tab"
+ default "Ctrl+T"
+ config SHORTCUT_SUBWINDOW_CLOSETAB
+ string "Close current tab"
+ default "Ctrl+X"
+ config SHORTCUT_SUBWINDOW_TABLEFT
+ string "Switch to the tab on the left"
+ default "Ctrl+O"
+ config SHORTCUT_SUBWINDOW_MOVETABLEFT
+ string "Move tab to the left"
+ default "Ctrl+Shift+O"
+ config SHORTCUT_SUBWINDOW_TABRIGHT
+ string "Switch to the tab on the right"
+ default "Ctrl+P"
+ config SHORTCUT_SUBWINDOW_MOVETABRIGHT
+ string "Move tab to the right"
+ default "Ctrl+Shift+P"
+
+endmenu
+
+menu "Profile defaults"
+ config PROFILE_DEFAULT
+ string "Default profile"
+ default ""
+ config PROFILE_DEFAULT_SEARCH
+ string "Search engine"
+ default "https://duckduckgo.com/?q=%1&ia=web"
+ config PROFILE_DEFAULT_HOMEPAGE
+ string "Homepage"
+ default "about:blank"
+ config PROFILE_DEFAULT_NEWTAB
+ string "New tab page"
+ default "about:blank"
+endmenu
+
diff --git a/lib/configuration/configuration.cpp b/lib/configuration/configuration.cpp
index 99efb14..388c7bd 100644
--- a/lib/configuration/configuration.cpp
+++ b/lib/configuration/configuration.cpp
@@ -67,39 +67,39 @@ Configuration::Configuration(QObject *parent)
("mainwindow.title", po::value<std::string>()->default_value(CONFIG_POI_NAME))
// main window shortcuts
- ("mainwindow.shortcuts.newGroup", po::value<std::string>()->default_value("Ctrl+G"))
- ("mainwindow.shortcuts.newWindow", po::value<std::string>()->default_value("Ctrl+N"))
+ ("mainwindow.shortcuts.newGroup", po::value<std::string>()->default_value(CONFIG_SHORTCUT_WINDOW_NEWGROUP))
+ ("mainwindow.shortcuts.newWindow", po::value<std::string>()->default_value(CONFIG_SHORTCUT_WINDOW_NEWWINDOW))
- ("mainwindow.shortcuts.about", po::value<std::string>()->default_value("Ctrl+H"))
- ("mainwindow.shortcuts.quit", po::value<std::string>()->default_value("Ctrl+Q"))
+ ("mainwindow.shortcuts.about", po::value<std::string>()->default_value(CONFIG_SHORTCUT_WINDOW_ABOUT))
+ ("mainwindow.shortcuts.quit", po::value<std::string>()->default_value(CONFIG_SHORTCUT_WINDOW_QUIT))
- ("mainwindow.shortcuts.search", po::value<std::string>()->default_value("F3"))
- ("mainwindow.shortcuts.tileWindows", po::value<std::string>()->default_value("F9"))
- ("mainwindow.shortcuts.cascadeWindows", po::value<std::string>()->default_value("F10"))
+ ("mainwindow.shortcuts.search", po::value<std::string>()->default_value(CONFIG_SHORTCUT_WINDOW_SEARCH))
+ ("mainwindow.shortcuts.tileWindows", po::value<std::string>()->default_value(CONFIG_SHORTCUT_SUBWINDOW_TILE))
+ ("mainwindow.shortcuts.cascadeWindows", po::value<std::string>()->default_value(CONFIG_SHORTCUT_SUBWINDOW_CASCADE))
// navigation
("navigation.movable", po::value<bool>()->default_value(false))
- ("navigation.shortcuts.back", po::value<std::string>()->default_value("Ctrl+Left"))
- ("navigation.shortcuts.backMenu", po::value<std::string>()->default_value("Ctrl+Down"))
- ("navigation.shortcuts.forward", po::value<std::string>()->default_value("Ctrl+Right"))
- ("navigation.shortcuts.forwardMenu", po::value<std::string>()->default_value("Ctrl+Up"))
- ("navigation.shortcuts.refresh", po::value<std::string>()->default_value("F5"))
- ("navigation.shortcuts.reload", po::value<std::string>()->default_value("Ctrl+F5"))
- ("navigation.shortcuts.home", po::value<std::string>()->default_value("Ctrl+Home"))
+ ("navigation.shortcuts.back", po::value<std::string>()->default_value(CONFIG_SHORTCUT_NAVIGATION_BACK))
+ ("navigation.shortcuts.backMenu", po::value<std::string>()->default_value(CONFIG_SHORTCUT_NAVIGATION_BACKMENU))
+ ("navigation.shortcuts.forward", po::value<std::string>()->default_value(CONFIG_SHORTCUT_NAVIGATION_FORWARD))
+ ("navigation.shortcuts.forwardMenu", po::value<std::string>()->default_value(CONFIG_SHORTCUT_NAVIGATION_FORWARDMENU))
+ ("navigation.shortcuts.refresh", po::value<std::string>()->default_value(CONFIG_SHORTCUT_NAVIGATION_REFRESH))
+ ("navigation.shortcuts.reload", po::value<std::string>()->default_value(CONFIG_SHORTCUT_NAVIGATION_RELOAD))
+ ("navigation.shortcuts.home", po::value<std::string>()->default_value(CONFIG_SHORTCUT_NAVIGATION_HOME))
// address bar
- ("addressbar.shortcuts.focus", po::value<std::string>()->default_value("F4"))
- ("addressbar.shortcuts.menu", po::value<std::string>()->default_value("F2"))
+ ("addressbar.shortcuts.focus", po::value<std::string>()->default_value(CONFIG_SHORTCUT_ADDRESS_FOCUS))
+ ("addressbar.shortcuts.menu", po::value<std::string>()->default_value(CONFIG_SHORTCUT_ADDRESS_MENU))
// subwindow
- ("subwindow.shortcuts.menu", po::value<std::string>()->default_value("F1"))
- ("subwindow.shortcuts.new", po::value<std::string>()->default_value("Ctrl+T"))
- ("subwindow.shortcuts.close", po::value<std::string>()->default_value("Ctrl+X"))
- ("subwindow.shortcuts.left", po::value<std::string>()->default_value("Ctrl+O"))
- ("subwindow.shortcuts.moveLeft", po::value<std::string>()->default_value("Ctrl+Shift+O"))
- ("subwindow.shortcuts.right", po::value<std::string>()->default_value("Ctrl+P"))
- ("subwindow.shortcuts.moveRight", po::value<std::string>()->default_value("Ctrl+Shift+P"))
- ("subwindow.shortcuts.fullscreen", po::value<std::string>()->default_value("F11"))
+ ("subwindow.shortcuts.menu", po::value<std::string>()->default_value(CONFIG_SHORTCUT_SUBWINDOW_MENU))
+ ("subwindow.shortcuts.new", po::value<std::string>()->default_value(CONFIG_SHORTCUT_SUBWINDOW_NEWTAB))
+ ("subwindow.shortcuts.close", po::value<std::string>()->default_value(CONFIG_SHORTCUT_SUBWINDOW_CLOSETAB))
+ ("subwindow.shortcuts.left", po::value<std::string>()->default_value(CONFIG_SHORTCUT_SUBWINDOW_TABLEFT))
+ ("subwindow.shortcuts.moveLeft", po::value<std::string>()->default_value(CONFIG_SHORTCUT_SUBWINDOW_MOVETABLEFT))
+ ("subwindow.shortcuts.right", po::value<std::string>()->default_value(CONFIG_SHORTCUT_SUBWINDOW_TABRIGHT))
+ ("subwindow.shortcuts.moveRight", po::value<std::string>()->default_value(CONFIG_SHORTCUT_SUBWINDOW_MOVETABRIGHT))
+ ("subwindow.shortcuts.fullscreen", po::value<std::string>()->default_value(CONFIG_SHORTCUT_SUBWINDOW_FULLSCREEN))
// Filter settings
("filter.hosts", po::value<std::string>()->default_value(CONFIG_PATH_FILTER))
@@ -114,19 +114,19 @@ Configuration::Configuration(QObject *parent)
// Profile settings
// default profile name the browser should use; "" is off-the-record
- ("profile.default", po::value<std::string>()->default_value(""))
+ ("profile.default", po::value<std::string>()->default_value(CONFIG_PROFILE_DEFAULT))
("profile.path", po::value<std::string>()->default_value(CONFIG_PATH_PROFILES))
- ("profile.search", po::value<std::string>()->default_value("https://duckduckgo.com/?q=%1&ia=web"))
- ("profile.homepage", po::value<std::string>()->default_value("about:blank"))
- ("profile.newtab", po::value<std::string>()->default_value("about:blank"))
+ ("profile.search", po::value<std::string>()->default_value(CONFIG_PROFILE_DEFAULT_SEARCH))
+ ("profile.homepage", po::value<std::string>()->default_value(CONFIG_PROFILE_DEFAULT_HOMEPAGE))
+ ("profile.newtab", po::value<std::string>()->default_value(CONFIG_PROFILE_DEFAULT_NEWTAB))
// Bookmark settings
("bookmarks.path", po::value<std::string>()->default_value(CONFIG_PATH_BOOKMARKS))
- ("bookmarks.shortcut", po::value<std::string>()->default_value("Ctrl+B"))
+ ("bookmarks.shortcut", po::value<std::string>()->default_value(CONFIG_SHORTCUT_WINDOW_BOOKMARKS))
// Downloads settings
("downloads.path", po::value<std::string>()->default_value(CONFIG_PATH_DOWNLOADS))
- ("downloads.shortcut", po::value<std::string>()->default_value("Ctrl+D"))
+ ("downloads.shortcut", po::value<std::string>()->default_value(CONFIG_SHORTCUT_WINDOW_DOWNLOADS))
;
}
diff --git a/linux/.config b/linux/.config
index 8eeef64..5cc898c 100644
--- a/linux/.config
+++ b/linux/.config
@@ -1,27 +1,9 @@
# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib)
#
-# Build system settings
-#
-
-#
-# Install paths
-#
-CONFIG_INSTALL_BINDIR="bin"
-CONFIG_INSTALL_LIBDIR="lib64/smolbote"
-CONFIG_INSTALL_PLUGINDIR="lib64/smolbote/plugins"
-CONFIG_INSTALL_APPDIR="share/applications"
-CONFIG_INSTALL_ICONDIR="share/icons"
-
-#
-# Application Settings
-#
-
-#
# Application
#
CONFIG_POI_NAME="smolbote"
-CONFIG_POI_EXE="poi"
CONFIG_POI_ICON=":/icon.svg"
#
@@ -33,6 +15,60 @@ CONFIG_PATH_PLUGINS="~/.config/smolbote/plugins.d"
CONFIG_PATH_PROFILES="~/.config/smolbote/profiles.d"
CONFIG_PATH_BOOKMARKS="~/.config/smolbote/bookmarks.xbel"
CONFIG_PATH_DOWNLOADS="~/Downloads"
+
+#
+# Keyboard shortcuts
+#
+
+#
+# Main Window shortcuts
+#
+CONFIG_SHORTCUT_WINDOW_NEWGROUP="Ctrl+G"
+CONFIG_SHORTCUT_WINDOW_NEWWINDOW="Ctrl+N"
+CONFIG_SHORTCUT_WINDOW_ABOUT="Ctrl+H"
+CONFIG_SHORTCUT_WINDOW_QUIT="Ctrl+Q"
+CONFIG_SHORTCUT_WINDOW_SEARCH="F3"
+CONFIG_SHORTCUT_WINDOW_BOOKMARKS="Ctrl+B"
+CONFIG_SHORTCUT_WINDOW_DOWNLOADS="Ctrl+D"
+
+#
+# Navigation Bar shortcuts
+#
+CONFIG_SHORTCUT_NAVIGATION_BACK="Ctrl+Left"
+CONFIG_SHORTCUT_NAVIGATION_BACKMENU="Ctrl+Down"
+CONFIG_SHORTCUT_NAVIGATION_FORWARD="Ctrl+Right"
+CONFIG_SHORTCUT_NAVIGATION_FORWARDMENU="Ctrl+Up"
+CONFIG_SHORTCUT_NAVIGATION_REFRESH="F5"
+CONFIG_SHORTCUT_NAVIGATION_RELOAD="Ctrl+F5"
+CONFIG_SHORTCUT_NAVIGATION_HOME="Ctrl+Home"
+
+#
+# Address Bar shortcuts
+#
+CONFIG_SHORTCUT_ADDRESS_FOCUS="F4"
+CONFIG_SHORTCUT_ADDRESS_MENU="F2"
+
+#
+# Subwindow shortcuts
+#
+CONFIG_SHORTCUT_SUBWINDOW_MENU="F1"
+CONFIG_SHORTCUT_SUBWINDOW_TILE="F9"
+CONFIG_SHORTCUT_SUBWINDOW_CASCADE="F10"
+CONFIG_SHORTCUT_SUBWINDOW_FULLSCREEN="F11"
+CONFIG_SHORTCUT_SUBWINDOW_NEWTAB="Ctrl+T"
+CONFIG_SHORTCUT_SUBWINDOW_CLOSETAB="Ctrl+X"
+CONFIG_SHORTCUT_SUBWINDOW_TABLEFT="Ctrl+O"
+CONFIG_SHORTCUT_SUBWINDOW_MOVETABLEFT="Ctrl+Shift+O"
+CONFIG_SHORTCUT_SUBWINDOW_TABRIGHT="Ctrl+P"
+CONFIG_SHORTCUT_SUBWINDOW_MOVETABRIGHT="Ctrl+Shift+P"
+
+#
+# Profile defaults
+#
+CONFIG_PROFILE_DEFAULT=""
+CONFIG_PROFILE_DEFAULT_SEARCH="https://duckduckgo.com/?q=%1&ia=web"
+CONFIG_PROFILE_DEFAULT_HOMEPAGE="about:blank"
+CONFIG_PROFILE_DEFAULT_NEWTAB="about:blank"
CONFIG_USEPLASMA=y
#
@@ -45,5 +81,4 @@ CONFIG_WALLET_FOLDER="smolbote"
#
# Workarounds
#
-CONFIG_QTBUG_62511=y
CONFIG_QTBUG_65223=y
diff --git a/linux/makepkg/PKGBUILD b/linux/makepkg/PKGBUILD
index bf62f9c..fc3d16d 100644
--- a/linux/makepkg/PKGBUILD
+++ b/linux/makepkg/PKGBUILD
@@ -14,15 +14,13 @@ license=('GPL3')
depends=('qt5-webengine>=5.11.0' 'boost-libs>=1.66.0')
optdepends=('firejail: launch a sandboxed instance')
-makedepends=('git' 'meson' 'pkg-config' 'asciidoctor')
+makedepends=('git' 'meson' 'pkg-config' 'python-kconfiglib' 'asciidoctor')
# this is the central repository
source=("git+https://neueland.iserlohn-fortress.net/gitea/aqua/smolbote.git"
- "git+https://github.com/itay-grudev/SingleApplication.git"
- "git+https://github.com/ulfalizer/Kconfiglib.git")
+ "git+https://github.com/itay-grudev/SingleApplication.git")
sha512sums=('SKIP'
- 'SKIP'
'SKIP')
#validgpgkeys=(# Aqua-sama <aqua@iserlohn-fortress.net>
@@ -34,8 +32,6 @@ prepare() {
git submodule init
git config submodule.3rd-party/SingleApplication/SingleApplication.git.url $srcdir/SingleApplication
git submodule update 3rd-party/SingleApplication/SingleApplication.git
- git config submodule.tools/Kconfiglib.url $srcdir/Kconfiglib
- git submodule update tools/Kconfiglib
}
pkgver() {
@@ -51,12 +47,19 @@ build() {
# For a list of configureable options, check smolbote/meson_options.txt, or
# run `meson configure` in $srcdir/build
- meson --buildtype=release --prefix=/usr/local --auto-features=disabled $srcdir/build
+ # --buildtype=plain - meson won't add any flags to the command line
+ # --prefix=... - install prefix
+ # --auto-features=disabled - features should be explicitly enabled
+ meson --buildtype=plain --prefix=/usr/local --auto-features=disabled $srcdir/build
- # Build
cd $srcdir/build
+
+ # Toggle features
+ #meson configure -DBreakpad=enabled
meson configure -DPlasma=enabled
meson configure -Dmanpage=enabled
+
+ # Build
ninja
}
diff --git a/tools/Kconfiglib b/tools/Kconfiglib
deleted file mode 160000
-Subproject 5d918357dd5734b900e1fdf074090ea662debd9
diff --git a/tools/config.py b/tools/config.py
index 9283fd8..11de99c 100755
--- a/tools/config.py
+++ b/tools/config.py
@@ -1,88 +1,20 @@
#!/usr/bin/env python3
+import os
import argparse
-from Kconfiglib import kconfiglib
-
-def search(node, term):
- while node:
- if isinstance(node.item, kconfiglib.Symbol):
- if node.item.name == term:
- return node.item.str_value
-
- if node.list:
- r = search(node.list, term)
- if r is not None:
- return r
-
- node = node.next
-
-def searchBug(node, term):
- bugs = ""
-
- while node:
- if isinstance(node.item, kconfiglib.Symbol):
- if node.item.name.startswith(term):
- if bugs is not "":
- bugs += ";"
- bugs += node.item.name
-
- if node.list:
- r = searchBug(node.list, term)
- if r is not None and r is not "":
- if bugs is not "":
- bugs += ";"
- bugs += r
-
- node = node.next
- return bugs
-
-def main(args):
- kconf = kconfiglib.Kconfig(args.kconfig)
- if args.dotconfig is not None:
- kconf.load_config(args.dotconfig)
-
- i = ""
- if args.setting.endswith("BUG"):
- i = searchBug(kconf.top_node, args.setting)
- else:
- i = search(kconf.top_node, args.setting)
-
- if i is not None:
- print(i)
-
-def writeItem(node, gen):
- while node:
- if isinstance(node.item, kconfiglib.Symbol):
- if node.item.str_value == 'y':
- gen.write("#define CONFIG_{0}\n".format(node.item.name))
- elif node.item.str_value == 'n':
- gen.write("#undef CONFIG_{0}\n".format(node.item.name))
- else:
- gen.write("#define CONFIG_{0} \"{1}\"\n".format(node.item.name, node.item.str_value))
-
- if node.list:
- writeItem(node.list, gen)
-
- node = node.next
-
-def generate(args):
- kconf = kconfiglib.Kconfig(args.kconfig)
- if args.dotconfig is not None:
- kconf.load_config(args.dotconfig)
-
- with open(args.generate, "wt") as gen:
- gen.write("// This is an auto-generated file, do not edit.\n")
- writeItem(kconf.top_node, gen)
+import subprocess
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--kconfig", metavar="Kconfig", nargs="?", default="Kconfig", help="Top-level Kconfig file (default: Kconfig)")
- parser.add_argument("--dotconfig", metavar="dotconfig", nargs="?", help=".config")
- parser.add_argument("--generate", metavar="config_header", nargs="?", help="Generate config file")
- parser.add_argument("setting", metavar="CONFIG_KEY", nargs="?", help="Top-level Kconfig file (default: Kconfig)")
+ parser.add_argument("--dotconfig", metavar="dotconfig", nargs="?", default=".config", help=".config")
+ parser.add_argument("--generate", metavar="config_header", nargs="?", default="config.h", help="Generate config file")
args = parser.parse_args()
- if args.generate is not None:
- generate(args)
- else:
- main(args)
+
+ # set srctree, otherwise includes don't work
+ os.environ["srctree"] = os.path.dirname(os.path.realpath(args.kconfig))
+ os.environ["KCONFIG_CONFIG"] = os.path.realpath(args.dotconfig)
+
+ subprocess.run(["genconfig", os.path.realpath(args.kconfig), "--header-path=" + args.generate], check=True)
+
diff --git a/windows/.config b/windows/.config
index 1ed238f..235612f 100644
--- a/windows/.config
+++ b/windows/.config
@@ -1,52 +1,78 @@
+# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib)
+
#
-# Automatically generated file; DO NOT EDIT.
-# smolbote configuration
+# Application
#
+CONFIG_POI_NAME="smolbote"
+CONFIG_POI_ICON=":/icons/poi.svg"
#
-# Build
+# Configuration defaults
#
+CONFIG_PATH_CONFIG="smolbote.cfg"
+CONFIG_PATH_FILTER="hosts"
+CONFIG_PATH_PLUGINS="plugins"
+CONFIG_PATH_PROFILES="profiles"
+CONFIG_PATH_BOOKMARKS="bookmarks.xbel"
+CONFIG_PATH_DOWNLOADS="~/Downloads"
#
-# Compiler settings
+# Keyboard shortcuts
#
-CONFIG_CXX_FLAGS=""
-CONFIG_CXX_FLAGS_DEBUG=""
-CONFIG_CXX_FLAGS_RELEASE=""
#
-# Install paths
+# Main Window shortcuts
#
-CONFIG_INSTALL_PREFIX=""
-CONFIG_INSTALL_BIN=""
-CONFIG_INSTALL_LIB="plugins"
+CONFIG_SHORTCUT_WINDOW_NEWGROUP="Ctrl+G"
+CONFIG_SHORTCUT_WINDOW_NEWWINDOW="Ctrl+N"
+CONFIG_SHORTCUT_WINDOW_ABOUT="Ctrl+H"
+CONFIG_SHORTCUT_WINDOW_QUIT="Ctrl+Q"
+CONFIG_SHORTCUT_WINDOW_SEARCH="F3"
+CONFIG_SHORTCUT_WINDOW_BOOKMARKS="Ctrl+B"
+CONFIG_SHORTCUT_WINDOW_DOWNLOADS="Ctrl+D"
#
-# Branding
+# Navigation Bar shortcuts
#
-CONFIG_POI_NAME="smolbote"
-CONFIG_POI_EXE="poi"
+CONFIG_SHORTCUT_NAVIGATION_BACK="Ctrl+Left"
+CONFIG_SHORTCUT_NAVIGATION_BACKMENU="Ctrl+Down"
+CONFIG_SHORTCUT_NAVIGATION_FORWARD="Ctrl+Right"
+CONFIG_SHORTCUT_NAVIGATION_FORWARDMENU="Ctrl+Up"
+CONFIG_SHORTCUT_NAVIGATION_REFRESH="F5"
+CONFIG_SHORTCUT_NAVIGATION_RELOAD="Ctrl+F5"
+CONFIG_SHORTCUT_NAVIGATION_HOME="Ctrl+Home"
#
-# Browser configuration
+# Address Bar shortcuts
#
+CONFIG_SHORTCUT_ADDRESS_FOCUS="F4"
+CONFIG_SHORTCUT_ADDRESS_MENU="F2"
#
-# Configuration defaults
+# Subwindow shortcuts
+#
+CONFIG_SHORTCUT_SUBWINDOW_MENU="F1"
+CONFIG_SHORTCUT_SUBWINDOW_TILE="F9"
+CONFIG_SHORTCUT_SUBWINDOW_CASCADE="F10"
+CONFIG_SHORTCUT_SUBWINDOW_FULLSCREEN="F11"
+CONFIG_SHORTCUT_SUBWINDOW_NEWTAB="Ctrl+T"
+CONFIG_SHORTCUT_SUBWINDOW_CLOSETAB="Ctrl+X"
+CONFIG_SHORTCUT_SUBWINDOW_TABLEFT="Ctrl+O"
+CONFIG_SHORTCUT_SUBWINDOW_MOVETABLEFT="Ctrl+Shift+O"
+CONFIG_SHORTCUT_SUBWINDOW_TABRIGHT="Ctrl+P"
+CONFIG_SHORTCUT_SUBWINDOW_MOVETABRIGHT="Ctrl+Shift+P"
+
#
-CONFIG_PATH_CONFIG="smolbote.cfg"
-CONFIG_PATH_CRASHDUMP="crashes"
-CONFIG_PATH_FILTER="hosts"
-CONFIG_PATH_PLUGINS="plugins"
-CONFIG_PATH_PROFILES="profiles"
-CONFIG_PATH_BOOKMARKS="bookmarks.xbel"
-CONFIG_PATH_DOWNLOADS="~/Downloads"
+# Profile defaults
+#
+CONFIG_PROFILE_DEFAULT=""
+CONFIG_PROFILE_DEFAULT_SEARCH="https://duckduckgo.com/?q=%1&ia=web"
+CONFIG_PROFILE_DEFAULT_HOMEPAGE="about:blank"
+CONFIG_PROFILE_DEFAULT_NEWTAB="about:blank"
# CONFIG_USEPLASMA is not set
# CONFIG_USEBREAKPAD is not set
#
-# Devel
+# Workarounds
#
-CONFIG_QTWARNINGS=y
-# CONFIG_TESTS is not set
-# CONFIG_LLVMLIBCPP is not set
+CONFIG_QTBUG_65223=y