From 597b6f74d41343f57e288694ec499e2303022f7e Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Tue, 18 Jan 2022 10:41:59 -0700 Subject: [PATCH] Add the icon. --- .gitignore | 2 + .kdev4/PrivacyBrowserPC.kdev4 | 48 +++++++- CMakeLists.txt | 27 ++++- PrivacyBrowserPC.kdev4 | 3 + README | 17 --- doc/CMakeLists.txt | 2 +- icons/16-apps-privacybrowserpc.png | Bin 625 -> 0 bytes icons/22-apps-privacybrowserpc.png | Bin 802 -> 0 bytes icons/32-apps-privacybrowserpc.png | Bin 1231 -> 0 bytes icons/48-apps-privacybrowserpc.png | Bin 1862 -> 0 bytes icons/CMakeLists.txt | 9 -- icons/sc-apps-privacybrowserpc.svgz | Bin 1780 -> 0 bytes src/CMakeLists.txt | 44 +++++--- src/icons/privacy_browser.svg | 105 ++++++++++++++++++ src/main.cpp | 100 +++++++++++------ ...vacybrowserpcwindow.cpp => mainwindow.cpp} | 43 ++++--- src/mainwindow.h | 72 ++++++++++++ src/privacybrowserpcview.cpp | 2 +- src/privacybrowserpcwindow.h | 58 ---------- src/resources.qrc | 24 ++++ 20 files changed, 401 insertions(+), 155 deletions(-) create mode 100644 .gitignore create mode 100644 PrivacyBrowserPC.kdev4 delete mode 100644 README delete mode 100644 icons/16-apps-privacybrowserpc.png delete mode 100644 icons/22-apps-privacybrowserpc.png delete mode 100644 icons/32-apps-privacybrowserpc.png delete mode 100644 icons/48-apps-privacybrowserpc.png delete mode 100644 icons/CMakeLists.txt delete mode 100644 icons/sc-apps-privacybrowserpc.svgz create mode 100644 src/icons/privacy_browser.svg rename src/{privacybrowserpcwindow.cpp => mainwindow.cpp} (59%) create mode 100644 src/mainwindow.h delete mode 100644 src/privacybrowserpcwindow.h create mode 100644 src/resources.qrc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9c087ba --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/build +/.kdev4 diff --git a/.kdev4/PrivacyBrowserPC.kdev4 b/.kdev4/PrivacyBrowserPC.kdev4 index 45d4a8d..9426400 100644 --- a/.kdev4/PrivacyBrowserPC.kdev4 +++ b/.kdev4/PrivacyBrowserPC.kdev4 @@ -1,5 +1,5 @@ [Buildset] -BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00 \x00P\x00r\x00i\x00v\x00a\x00c\x00y\x00B\x00r\x00o\x00w\x00s\x00e\x00r\x00P\x00C) +BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00\x1c\x00P\x00r\x00i\x00v\x00a\x00c\x00y\x00B\x00r\x00o\x00w\x00s\x00e\x00r) [CMake] Build Directory Count=1 @@ -12,5 +12,49 @@ CMake Binary=/usr/bin/cmake CMake Executable=/usr/bin/cmake Environment Profile= Extra Arguments= -Install Directory= +Install Directory=/usr Runtime=Host System + +[CustomDefinesAndIncludes][ProjectPath0] +Path=. +parseAmbiguousAsCPP=true +parserArguments=-ferror-limit=100 -fspell-checking -Wdocumentation -Wunused-parameter -Wunreachable-code -Wall -std=c++17 +parserArgumentsC=-ferror-limit=100 -fspell-checking -Wdocumentation -Wunused-parameter -Wunreachable-code -Wall -std=c99 +parserArgumentsCuda=-ferror-limit=100 -fspell-checking -Wdocumentation -Wunused-parameter -Wunreachable-code -Wall -std=c++11 +parserArgumentsOpenCL=-ferror-limit=100 -fspell-checking -Wdocumentation -Wunused-parameter -Wunreachable-code -Wall -cl-std=CL1.1 + +[CustomDefinesAndIncludes][ProjectPath0][Compiler] +Name=GCC + +[Launch] +Launch Configurations=Launch Configuration 0 + +[Launch][Launch Configuration 0] +Configured Launch Modes=execute +Configured Launchers=nativeAppLauncher +Name=New Compiled Binary Launcher +Type=Native Application + +[Launch][Launch Configuration 0][Data] +Arguments= +Debugger Shell= +Dependencies=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x00) +Dependency Action=Nothing +Display Demangle Names=true +Display Static Members=false +EnvironmentGroup= +Executable=file:///home/soren/projects/PrivacyBrowserPC/build/bin/privacybrowser +External Terminal=konsole --noclose --workdir %workdir -e %exe +GDB Path= +Kill Before Executing Again=4194304 +Project Target=PrivacyBrowserPC,src,privacybrowserpc +Remote GDB Config Script= +Remote GDB Run Script= +Remote GDB Shell Script= +Start With=ApplicationOutput +Use External Terminal=false +Working Directory= +isExecutable=true + +[Project] +VersionControlSupport=kdevgit diff --git a/CMakeLists.txt b/CMakeLists.txt index 2326479..ca98f35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,29 @@ +# Copyright © 2022 Soren Stoutner . +# +# This file is part of Privacy Browser PC . +# +# Privacy Browser PC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Privacy Browser PC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Privacy Browser PC. If not, see . + cmake_minimum_required(VERSION 3.16) -project(privacybrowserpc) +project(privacybrowser) +# Set the minimum framework versions. set(QT_MIN_VERSION "5.15.0") -set(KF_MIN_VERSION "5.83.0") +set(KDE_FRAMEWORKS_MIN_VERSION "5.83.0") -find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE) +find_package(ECM ${KDE_FRAMEWORKS_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) include(KDEInstallDirs) @@ -18,7 +36,7 @@ include(FeatureSummary) find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Gui Widgets) -find_package(KF5 ${KF_MIN_VERSION} REQUIRED COMPONENTS +find_package(KF5 ${KDE_FRAMEWORKS_MIN_VERSION} REQUIRED COMPONENTS ConfigWidgets CoreAddons Crash @@ -30,7 +48,6 @@ find_package(KF5 ${KF_MIN_VERSION} REQUIRED COMPONENTS add_subdirectory(doc) add_subdirectory(src) -add_subdirectory(icons) # Make it possible to use the po files fetched by the fetch-translations step ki18n_install(po) diff --git a/PrivacyBrowserPC.kdev4 b/PrivacyBrowserPC.kdev4 new file mode 100644 index 0000000..9125910 --- /dev/null +++ b/PrivacyBrowserPC.kdev4 @@ -0,0 +1,3 @@ +[Project] +Manager=KDevCMakeManager +Name=PrivacyBrowser diff --git a/README b/README deleted file mode 100644 index 21a8f91..0000000 --- a/README +++ /dev/null @@ -1,17 +0,0 @@ -How To Build This Template --=-=-=-=-=-=-=-=-=-=-=-=-= - ---- On Unix: - -cd -mkdir build -cd build -cmake -DCMAKE_INSTALL_PREFIX=$KDEDIRS -DCMAKE_BUILD_TYPE=Debug .. -make -make install or su -c 'make install' or sudo make install - -where $KDEDIRS points to your KDE installation prefix. - -Note: you can use another build path. Then cd in your build dir and: -export KDE_SRC=path_to_your_src -cmake $KDE_SRC -DCMAKE_INSTALL_PREFIX=$KDEDIRS -DCMAKE_BUILD_TYPE=Debug diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 77c1fb1..ffd9ed3 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1 +1 @@ -kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR privacybrowserpc) +kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR privacybrowser) diff --git a/icons/16-apps-privacybrowserpc.png b/icons/16-apps-privacybrowserpc.png deleted file mode 100644 index 1d17e6fd742c7256161532576c6cfa21e6e9dda5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 625 zcmV-%0*?KOP)Ll09e?Q51#0JDa#W79&{1 zq*E{`SfmuOh+62fc|%yjB4VSg3TZ?|3&Aw0(-;UCP#Zyu5n*>GC`6GIHiC#h(b#Cx zB#nsdDlbFUxi+)QY+@=;_ujqtd-oiku#JkvVm_bG4NuGMNi6p=ol z;W*CN{QUgyEr2MB9;xappb1LPg;3;qrmj( z0UXEK2b@#YzDlLCV>1AtP$*mnzNW|7(b3Vp9SgNuZ5dcL#+mq&7)+AnM%G#f&}=rRM5NkiG!8{kR8`fxB62`g zpGQ%2#&zAJsyeQ!*Rp`lS6*0HXaV;#wb$(uKoA6ffII&R_`mcQT-e;_z3qo>00000 LNkvXXu0mjf?|cup diff --git a/icons/22-apps-privacybrowserpc.png b/icons/22-apps-privacybrowserpc.png deleted file mode 100644 index 68d71892d4b54bdcb05b838df3b1e511fff36725..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 802 zcmV+-1Ks?IP)bl|hJAWf+E^_rFH7k)UGK zkwU>$MlJ5DT$BWcp8wp7BjZME6;qK=6toa(L<4EzD#)0iHlj6ZHTRrzr6CBSfk-Bd zY9|ziGntWuo4MmX|L5jhIdkW9uN&Xh`Tp-c5AS&o_a3-M(lA4#(O7S0p97nKjn27U zv$M0m08CC!-nX>0bOyKq%md#iNpcxr-7s(n;eJWGt9FZvi^nDHE5?`1>=^JafV+#Q zTBUBcYXET^dr5DWR$tfa^&`DuO%-t*zX4oMk|YK2-ajnq`kfo3?UHVW5H0}^0+`t! zD=RDYxw*N2E5Y9TS0tS*%%^I#+Q~f6Z%O*G=W)(Gk>~kGlAbP(Iw6D|S(Yu7S*xlr zvx{aHiev{v2=kJ*l|3PZqa`S2cBmg(S%vrhLrJfi*?*D_n%NKKD*A$ak*4Xss$JE~ z`wB4U+}>W#eY#P)ekO{d%|pS>W^;?Ax6JHZtJV7Ue^R~S2TKb8Db-utJj zz%yoc*3A9}$n$)Z0h*qkz6HDpbc&;O!0CyJi3e7Jvn*?;X}Uj6(+$7{NzouMK$0ZC znb|v~)LWL9m)~CnE=$sk(CKvk1c>8!Tv7nenb`*+gq3Zs#*=Lg4 zMgNZim2=Kufz07*qoM6N<$f;8lO!TSXoO*S763F&gNOjY z7=Q+Vj*gC90M<-QOjIq)I!yAAh#d5N|H~O4ZLR=WBH6Gz%d$2CSQD>zl3WSk4FC@( z{cZ?=#K$lr$8jDc`Cf*f@B99?8xBCS4&XRWr&8*30J&80GrF#?127A=X%E=8{j`YO zR;^aIkB^UstpG%%{t1*)J4r4{tzQmlj zZ>zxi9O&=w?=}qMAra{X&eXB>w=y{cNESq7Z?RbH9UmXB zWyRG`K-cxNB2ohII)KLkb zlvJryIt1X|j65%xra9OSAWQmO005v+C~Qq%VF1uHZP&oSz~ZI=VHn<}l-eL7p91(L zHs3v00M~V|h{!q-N#FkkN~zC=hK6QsstzzZI(jMyf{%RPU*~z=?Et6sG%P6C(`k;NpJ0mzBS6_WGPIh9go z5CmUj0W>tBuInNGy@rUd(>B8}ZUykNhka9M#%wl&~@GDI`jN5`~wJ2_=xPs_1FLa002ovPDHLkV1m!3JR<-A diff --git a/icons/48-apps-privacybrowserpc.png b/icons/48-apps-privacybrowserpc.png deleted file mode 100644 index 38e246ab872e0e88a27e830e3c8794645155d1bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1862 zcmV-M2f6r(P)JAaq zESok#YbXA|vPRlkj2)0@rZe|UTgU~{9<{Ti6inDqH~&w0=DzVCU@Iq!SU z1uo$Hg54x5l}f!NFY`RFPel3v^pU(&MEVTFc)@X;`=iF^^Z5nobb1+pL$2%oBZSKh}BCYP)eNua7aWBo2GeaU|`_b)~#DT z|2U(Y4n%>ZMD=GfnS0SPzJ(6}SV!^!&-0Fsj*kATP$&%e$GvS1h{&ATn?|WrDgyX= z48^XYp`qXT8_#BYHm$Tb6ZaP{(Ay@45$nM4@bDzbjUh^Z z(BI#`yi%$BvQx!Ao_{tPjhn)fRTL5>GRJW$BC^+~^d7DCmv-*lS?^S-A0#hMrBWY! zGh-8HVv>Jp`+QPsy}3hO|BdKN0oXk_ICxQqoXH$06bgL+ZU+DnIb)jUhE5fU$PWR8 zo-QOWo0yo`*(q-#2Tara9L^o3+xP6*bEZ>8n2Nw>MI>~clf1#U?Jsmf8kh&xuV0@& zefsnjBC-^~QV}V&ZdeTfyE;+O4%c-@Y}?)j;M-v`B=0X23WtV%E|*(AJUl!Z$2V&Uk^C}% zWeCo^5Ru<@Y_SjJa`|qO-BFd33dGMUWwBz&FT2maond>~xcJxcQK7_l!ZrB=sr zb>x6y7;pK^pT@j-^R@x_b&S}<`Fwssq)oo>$d>~Vd3OTa5}{l!H$Bh0718*w?hX+-7$dg1SS)@bs3W$Vb{ywnOkF8K@>1KjgDyC4 z1=46VZWEDL!vsj0Bp)dji*uH6qD@S4ciU%V$U8-$P#9=7n`0spR`E6gJP%+yNz>n- z=vBgToM&v?K1y;4$xqp~eZAKDsSt4i@K+J3k~}UVRS`Mf)6;XrFE}_j*fTjf`6JUb zM_kw4pp;q*U=4u(iO502Fn%r~j_bOi$useKwryLJEVe$!JkMM1zxu6Nv*waUqcNei zjyhRppp<$5z;t1_DwRsTSg+TwF$`nKah%A<;Eo(9l}a~>$fLgImq~uwah&5xIQ)8* zQuhIvc^49qlOl3?rBWH|glNv1@*|(mzt=E~3V`{(u8TzEGudqR&(&)6SW<;+*RFlv z;>C*}1#nw?JIP*>S7x)>cU7y^-z4RWjeu?2kCVJ1M(lYJ*=AYR(_z=b*3XOE0c^z7 z`%)l8q-hw&Qpa)T?3o}$I-r!g4nWvu4N`svz^?!t2QWr54PYUFj{^8eoW3@m5v}!A zh^Y(^N2ru~0aMj!kdiup2LY@gd1VsATI0?F*a2V}$!j9yN?L0-jxRC~G#ZU{t>$)$7$!4?J50m_uzg4mPf4hi0r?u{O4F#afe`q|<3p>AuyQ!xgU3FmJzI`u= z$iMyVBJ%&?001HBzb3wR_Uze_F6+5~3+NW!0GY$Ui%VV~B>(^b07*qoM6N<$g4lU> AzW@LL diff --git a/icons/CMakeLists.txt b/icons/CMakeLists.txt deleted file mode 100644 index cbea1cb..0000000 --- a/icons/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -set(privacybrowserpc_ICONS - 16-apps-privacybrowserpc.png - 22-apps-privacybrowserpc.png - 32-apps-privacybrowserpc.png - 48-apps-privacybrowserpc.png - sc-apps-privacybrowserpc.svgz -) - -ecm_install_icons(ICONS ${privacybrowserpc_ICONS} DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor) diff --git a/icons/sc-apps-privacybrowserpc.svgz b/icons/sc-apps-privacybrowserpc.svgz deleted file mode 100644 index b29c626f2486ec14633369eefa7ca2ef16f4d259..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1780 zcmV3p_B4bTg^>y2AH`#yw{Iv)f8>h0X%U$0!o2=`zpYLvNe<%v}%g~fl zQ?pY$J+j}rFJo068usJkG#%Ef)#-HN?ODkCVY~W?6~*1n&F%QKyW7OqWpmO=NyZpg zLamf4pizu3-BdmoZ%vWow@j4~Vuib_=KrU)9s%e9|1au`fRFugsG0}ZHN0!4)#pDy zUoH#5>#2U_X2J7K)Hfh^<-QpYWz~$UMV{)sZO;j!J80b2 z&BI8Vb2vI7p32xN-Cpd;xTZ|6y7%Qc*T>kQ+=2_ce%NH69@5YG;=Uj1W>~IV`gwEJ z1Fv>^nc08#y;MbBFZbfx_v2$(_oq#!-d}$0`~4;}@5L2xwwgyHj0qnu5ywR?f_3JD zLm+shxhRfZJAr$L=MUz`VIYNF`O=`=^h=(V#>f7&9SF8*I4-b#*VEXQhvNR8NbySj za!ofy*VoPX=03$Zwn_X@?#2&xr?vxF#llB@>BW1Eg`zI{?`RNRzjO8S{i}WX-0s`2 zO-(9yN$2*WL-5RIj7={zXwNSs%N8M_M*?fKSqQrN$j~I;H&a=cQ+cK9A_2Ya5*s^c z{m18D@6Hi!t7`q?a<8Y=bJmYuJ$b%t^Pf=yWMXTQ$Aus|AL1 z+P-VkuDow{o9uUDE|c$@xE=cAVGr7!xt(3XeZ%!>D7%qhAa>$$hd0%aA}^vcTsx(H zTHrsF)8nPNOO%UsQDK;xf%s%4cQPvLvj43PW){YBEHM}38}3jz>!SKg{Z$D3yLuyf zFt54R()f@^?NXwV71DDBPuAy1!5JoUFS(LJONJ{cm5Dwt6t`X~Toziu(%Zn4;xTFw ze6BTj-f8Uhz=aOc+q|&cOJP`{G`9{y2}{LwloFPjdlQY7$(z;QLJ_t`dZ~3@7_PK+ zuvI(=jTdU3)PhEKT)OB243VU_R_fK!O3V<$gx?il62NV zc}HhBrL$ELqXvO8hV5A4xCg8z(0`NM4NcWaPDUDT-Fe68H)49o%?q zU+DrQ8mra>@*=qr(MFjA1kVUh9kq|S;na0h0Iv>la?hO-DH&-1dH~ir+?d&ofEx?w zsD_Y&g9Bg=&L&~@N)W7q8<9uugd=N_CvyiBl^3X#YOpp5oRg@RtPJd7hv?ENFDbfl zA}De|>Jt3XTq>!VU}rkyw~SAEGRphy(&KlAIzj>{tQbY2vKHo+ea;kU&+6 zGe|h4RRHmPbi_B>Eda|>mocHlwe!04Kte99rcLLSpiV;oJ`w6@bDTBMrLULw%Q(I4 z@Ybx`@qjla{*>6YUGvWeyxP~Fv^Lh*bSTbWyKDLJJy-Qz*HlwK6!^@1DyQSn&_~qr W8MMXUh4dM6ck?%yH1`lz4gdg)@@dTg diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 75bdc67..077ff05 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,23 +1,41 @@ -add_executable(privacybrowserpc) +# Copyright © 2022 Soren Stoutner . +# +# This file is part of Privacy Browser PC . +# +# Privacy Browser PC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Privacy Browser PC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Privacy Browser PC. If not, see . -target_sources(privacybrowserpc PRIVATE +# Create the executable and add the resources. +add_executable(privacybrowser resources.qrc) + +target_sources(privacybrowser PRIVATE main.cpp - privacybrowserpcwindow.cpp + mainwindow.cpp privacybrowserpcview.cpp ) -ecm_qt_declare_logging_category(privacybrowserpc +ecm_qt_declare_logging_category(privacybrowser HEADER privacybrowserpcdebug.h - IDENTIFIER PRIVACYBROWSERPC - CATEGORY_NAME "privacybrowserpc" + IDENTIFIER PRIVACYBROWSER + CATEGORY_NAME "privacybrowser" ) -kconfig_add_kcfg_files(privacybrowserpc PrivacyBrowserPCSettings.kcfgc) -ki18n_wrap_ui(privacybrowserpc +kconfig_add_kcfg_files(privacybrowser PrivacyBrowserPCSettings.kcfgc) +ki18n_wrap_ui(privacybrowser privacybrowserpcview.ui settings.ui ) -target_link_libraries(privacybrowserpc +target_link_libraries(privacybrowser KF5::CoreAddons KF5::I18n KF5::XmlGui @@ -27,7 +45,7 @@ target_link_libraries(privacybrowserpc Qt5::Widgets ) -install(TARGETS privacybrowserpc ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) -install(PROGRAMS org.example.privacybrowserpc.desktop DESTINATION ${KDE_INSTALL_APPDIR}) -install(FILES org.example.privacybrowserpc.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) -install(FILES privacybrowserpcui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/privacybrowserpc) +install(TARGETS privacybrowser ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) +install(PROGRAMS com.stoutner.privacybrowser DESTINATION ${KDE_INSTALL_APPDIR}) +install(FILES com.stounter.privacybrowser.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) +install(FILES privacybrowserpcui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/privacybrowser) # TODO diff --git a/src/icons/privacy_browser.svg b/src/icons/privacy_browser.svg new file mode 100644 index 0000000..5d39ed4 --- /dev/null +++ b/src/icons/privacy_browser.svg @@ -0,0 +1,105 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/src/main.cpp b/src/main.cpp index 41f54d1..f0ffdec 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,57 +1,91 @@ /* - SPDX-FileCopyrightText: %{CURRENT_YEAR} %{AUTHOR} <%{EMAIL}> + * Copyright © 2022 Soren Stoutner . + * + * This file is part of Privacy Browser PC . + * + * Privacy Browser PC is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Privacy Browser PC is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Privacy Browser PC. If not, see . + */ - SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL -*/ +// Application headers. +#include "mainwindow.h" +#include "privacybrowserpcdebug.h" // TODO. Rename. -// application header -#include "privacybrowserpcwindow.h" -#include "privacybrowserpcdebug.h" - -// KF headers +// KDE Frameworks headers. +#include #include #include -#include -#include +#include // TODO. This may not be needed. -// Qt headers -#include +// Qt headers. +#include // TODO. Probably not needed. Appears to be included in a sub header. #include -#include -#include +#include // TODO. Probably not needed. Appears to be included in a sub header. +#include // Probably not needed at all. - -int main(int argc, char **argv) +int main(int argc, char *argv[]) { + // Create the application. QApplication application(argc, argv); - KLocalizedString::setApplicationDomain("privacybrowserpc"); + // Set the localization application domain. + KLocalizedString::setApplicationDomain("privacybrowser"); + + // Initialize KCrash. KCrash::initialize(); - KAboutData aboutData( QStringLiteral("privacybrowserpc"), - i18n("PrivacyBrowserPC"), - QStringLiteral("%{VERSION}"), - i18n("A Simple Application written with KDE Frameworks"), - KAboutLicense::GPL, - i18n("Copyright %{CURRENT_YEAR}, %{AUTHOR} <%{EMAIL}>")); + // Instantiate about data. + KAboutData aboutData(QStringLiteral("privacybrowser"), i18n("Privacy Browser"), QStringLiteral("0.1")); - aboutData.addAuthor(i18n("%{AUTHOR}"),i18n("Author"), QStringLiteral("%{EMAIL}")); - aboutData.setOrganizationDomain("example.org"); - aboutData.setDesktopFileName(QStringLiteral("org.example.privacybrowserpc")); + // Add the author information. + aboutData.addAuthor(i18n("Soren Stoutner"),i18n("Principal developer"), QStringLiteral("soren@stoutner.com"), QStringLiteral("https://www.stoutner.com/")); + // Populate additional about data info. TODO, OrLaterVersions does not work. The solution is probably to use a custom license file. + aboutData.setBugAddress("https://redmine.stoutner.com/projects/privacy-browser/issues"); // TODO. Update the URL. + aboutData.setCopyrightStatement(i18n("Copyright © 2022 Soren Stoutner ")); + aboutData.setDesktopFileName(QStringLiteral("com.stoutner.privacybrowser")); + aboutData.setHomepage(QStringLiteral("https://www.stoutner.com/privacy-browser-pc/")); + aboutData.setLicense(KAboutLicense::GPL_V3, KAboutLicense::OrLaterVersions); + aboutData.setOrganizationDomain("stoutner.com"); + aboutData.setShortDescription(i18n("A web browser that respects your privacy.")); + + // Set the application data. KAboutData::setApplicationData(aboutData); - application.setWindowIcon(QIcon::fromTheme(QStringLiteral("privacybrowserpc"))); - QCommandLineParser parser; - aboutData.setupCommandLine(&parser); + // Set the window icon. + application.setWindowIcon(QIcon::fromTheme(QStringLiteral("privacybrowser"), QIcon(":/icons/privacy_browser.svg"))); + + // Create a command line parser. + QCommandLineParser commandLineParser; + + // Process the command line through about data (this adds --license and --author). + aboutData.setupCommandLine(&commandLineParser); - parser.process(application); - aboutData.processCommandLine(&parser); + // Process the application command line options (this adds --version, --help, and --help-all). + commandLineParser.process(application); + // Make it so. + aboutData.processCommandLine(&commandLineParser); + + // TODO. KDBusService appDBusService(KDBusService::Multiple | KDBusService::NoExitOnFailure); - PrivacyBrowserPCWindow *window = new PrivacyBrowserPCWindow; - window->show(); + // Create the main window. + MainWindow *mainWindowPointer = new MainWindow; + + // Show the main window. + mainWindowPointer->show(); + // Return the application. return application.exec(); } diff --git a/src/privacybrowserpcwindow.cpp b/src/mainwindow.cpp similarity index 59% rename from src/privacybrowserpcwindow.cpp rename to src/mainwindow.cpp index d27ea98..739fca9 100644 --- a/src/privacybrowserpcwindow.cpp +++ b/src/mainwindow.cpp @@ -1,22 +1,33 @@ /* - SPDX-FileCopyrightText: %{CURRENT_YEAR} %{AUTHOR} <%{EMAIL}> - - SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL -*/ - -// application headers -#include "privacybrowserpcwindow.h" + * Copyright © 2022 Soren Stoutner . + * + * This file is part of Privacy Browser PC . + * + * Privacy Browser PC is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Privacy Browser PC is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Privacy Browser PC. If not, see . + */ +// Application headers. +#include "mainwindow.h" #include "privacybrowserpcview.h" #include "privacybrowserpcdebug.h" -// KF headers +// KDE Frameworks headers. #include #include -PrivacyBrowserPCWindow::PrivacyBrowserPCWindow() - : KXmlGuiWindow() +MainWindow::MainWindow() : KXmlGuiWindow() { m_privacybrowserpcView = new PrivacyBrowserPCView(this); setCentralWidget(m_privacybrowserpcView); @@ -34,19 +45,19 @@ PrivacyBrowserPCWindow::PrivacyBrowserPCWindow() setupGUI(); } -PrivacyBrowserPCWindow::~PrivacyBrowserPCWindow() +MainWindow::~MainWindow() { } -void PrivacyBrowserPCWindow::fileNew() +void MainWindow::fileNew() { - qCDebug(PRIVACYBROWSERPC) << "PrivacyBrowserPCWindow::fileNew()"; - (new PrivacyBrowserPCWindow)->show(); + qCDebug(PRIVACYBROWSER) << "PrivacyBrowserPCWindow::fileNew()"; + (new MainWindow)->show(); } -void PrivacyBrowserPCWindow::settingsConfigure() +void MainWindow::settingsConfigure() { - qCDebug(PRIVACYBROWSERPC) << "PrivacyBrowserPCWindow::settingsConfigure()"; + qCDebug(PRIVACYBROWSER) << "MainWindow::settingsConfigure()"; // The preference dialog is derived from prefs_base.ui // // compare the names of the widgets in the .ui file diff --git a/src/mainwindow.h b/src/mainwindow.h new file mode 100644 index 0000000..a70db9f --- /dev/null +++ b/src/mainwindow.h @@ -0,0 +1,72 @@ +/* + * Copyright © 2022 Soren Stoutner . + * + * This file is part of Privacy Browser PC . + * + * Privacy Browser PC is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Privacy Browser PC is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Privacy Browser PC. If not, see . + */ + +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +// Application headers. +#include "ui_settings.h" +#include "PrivacyBrowserPCSettings.h" + +// KDE Frameworks headers. +#include + +// TODO. What is this doing here? +class PrivacyBrowserPCView; + +/** TODO. Remove. + * This class serves as the main window for privacybrowserpc. It handles the + * menus, toolbars and status bars. + * + * @short Main window class + * @author %{AUTHOR} <%{EMAIL}> + * @version %{VERSION} + */ +class MainWindow : public KXmlGuiWindow // TODO. Checkout documentation. +{ + // Include the Q_OBJECT macro. + Q_OBJECT + +public: + // The default constructor. + MainWindow(); + + + // The default destructor. TODO, this could probably be removed. + ~MainWindow() override; + +private Q_SLOTS: + /** + * Create a new window + */ + void fileNew(); + + /** + * Open the settings dialog + */ + void settingsConfigure(); + +private: + // this is the name of the root widget inside our Ui file + // you can rename it in designer and then change it here + Ui::Settings m_settings; + QAction *m_switchAction; + PrivacyBrowserPCView *m_privacybrowserpcView; +}; +#endif diff --git a/src/privacybrowserpcview.cpp b/src/privacybrowserpcview.cpp index 7a903aa..84e5eed 100644 --- a/src/privacybrowserpcview.cpp +++ b/src/privacybrowserpcview.cpp @@ -34,7 +34,7 @@ void PrivacyBrowserPCView::switchColors() void PrivacyBrowserPCView::handleSettingsChanged() { - qCDebug(PRIVACYBROWSERPC) << "PrivacyBrowserPCView::handleSettingsChanged()"; + qCDebug(PRIVACYBROWSER) << "PrivacyBrowserPCView::handleSettingsChanged()"; QPalette palette = m_ui.templateLabel->palette(); palette.setColor(QPalette::Window, PrivacyBrowserPCSettings::colorBackground()); palette.setColor(QPalette::WindowText, PrivacyBrowserPCSettings::colorForeground()); diff --git a/src/privacybrowserpcwindow.h b/src/privacybrowserpcwindow.h deleted file mode 100644 index 77fd554..0000000 --- a/src/privacybrowserpcwindow.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - SPDX-FileCopyrightText: %{CURRENT_YEAR} %{AUTHOR} <%{EMAIL}> - - SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL -*/ - -#ifndef PRIVACYBROWSERPCWINDOW_H -#define PRIVACYBROWSERPCWINDOW_H - -#include - -#include "ui_settings.h" -#include "PrivacyBrowserPCSettings.h" - -class PrivacyBrowserPCView; - -/** - * This class serves as the main window for privacybrowserpc. It handles the - * menus, toolbars and status bars. - * - * @short Main window class - * @author %{AUTHOR} <%{EMAIL}> - * @version %{VERSION} - */ -class PrivacyBrowserPCWindow : public KXmlGuiWindow -{ - Q_OBJECT -public: - /** - * Default Constructor - */ - PrivacyBrowserPCWindow(); - - /** - * Default Destructor - */ - ~PrivacyBrowserPCWindow() override; - -private Q_SLOTS: - /** - * Create a new window - */ - void fileNew(); - - /** - * Open the settings dialog - */ - void settingsConfigure(); - -private: - // this is the name of the root widget inside our Ui file - // you can rename it in designer and then change it here - Ui::Settings m_settings; - QAction *m_switchAction; - PrivacyBrowserPCView *m_privacybrowserpcView; -}; - -#endif // PRIVACYBROWSERPCWINDOW_H diff --git a/src/resources.qrc b/src/resources.qrc new file mode 100644 index 0000000..7603240 --- /dev/null +++ b/src/resources.qrc @@ -0,0 +1,24 @@ + + + + + + icons/privacy_browser.svg + + -- 2.43.0