Commit graph

720 commits

Author SHA1 Message Date
Ivailo Monev
eebedd4c76 kdeui: send locale and language change events from KGlobalSettings
the signals come from the locale KCM however applications, libraries and
widgets handling of such changes is mixed - some do it on
QEvent::LocaleChange, some on QEvent::LanguageChange, some when the
KGlobalSettings signal is send so sending the events will make sure that
locale changes take effect immediatly (when and wherethe event is watched
for ofcourse, KCalendarWidget does it for one)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-29 07:55:01 +03:00
Ivailo Monev
8da6fa7558 kdeui: preserve the translations order in KSwitchLanguageDialog
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-28 11:53:06 +03:00
Ivailo Monev
b8c4f73865 kdeui: implement KSwitchLanguageDialog
note that it does not change the locale language (yet), nor does is affect
it. it changes the translation language(s) - two different things!

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-28 11:16:27 +03:00
Ivailo Monev
b7e54f8e21 kdeui: stub KSwitchLanguageDialog
to be rewritten. date, time, days, etc. translation and conversion work
like a charm tho (when translated and supported by the locale classes
ofcourse):
https://ibb.co/hcW0dL3

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-28 00:40:39 +03:00
Ivailo Monev
1a45508306 kdecore: reimplement KLocale
by using QLocale in KLocale and separating the date, time and numbers
conversion from translation KLocale actually gets extended locale
support from QLocale (which uses CLDR data v43 currently). translation
remains unaffected. for comparison here is the result of two function
calls the result of which should explain the whole change:
KLocale::allLanguagesList().size() = 669
KLocale::installedLanguages().size() = 68

the first number is locales Katie supports, the second being the
number of languages Katana is translated into

KSwitchLanguageDialog needs a rewrite but that is on the TODO

also copyrighting KCatalog to me because I rewrote it, for reference:
881b47b8ea

KCalendarSystem gets the middle finger - batteries not included for date
and time. extra calendar systems can, but are unlikely to be, supported
in the future

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-26 23:50:18 +03:00
Ivailo Monev
6d3811054d kdeui: adapt KCalendarWidget to locale and language changes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-23 12:02:13 +03:00
Ivailo Monev
3c697cf8ce kdeui: implement setter and getter for KCalendarWidget to use a specifiec KCalendarSystem
maybe temporary tho but for now the minimum and maximum date will be that
of the KCalendarSystem

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-23 11:29:06 +03:00
Ivailo Monev
8f8865db62 kdeui: do not warn from setupCalendarWidget() if the system locale name is "C"
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-23 08:21:55 +03:00
Ivailo Monev
6c2c0efda8 kdeui: remove unused klocale header inclusion in kcalendarwidget header
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-23 06:20:32 +03:00
Ivailo Monev
061a11fd43 kdeui: replace KDatePicker/KDateTable with new KCalendarWidget class
interestingly QLocale is not used for many things but that is about to
change, Katie uses it a lot internally (e.g. for QDateTime formatting
and such) so instead of bolting a calendar system on top of KLocale
perhaps a QLocale wrapped around in KLocale will fit the general idea
of using QLocale in widgets when necessary (as does QCalendarWidget).

that however means no way to specify a calendar system (in general,
other than changing the widgets locale itself) but the QDateTime and
related classes are tied to gregorian calendar already - the system
time itself carries no information about the calendar and any
conversions from one calendar to another are basically made up stuff
(there is the time zone thing ofcourse but that is not a calendar)

another interesting thing to note is that KLocale was written such that
it is read-write - changing the date formats for example is possible
because there are public KLocale methods for that.

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-23 06:16:56 +03:00
Ivailo Monev
e84a04fa67 kdeui: remove forward-declaration of now non-existing KTimeZones class
replaced with KTimeZoneList

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-23 02:50:53 +03:00
Ivailo Monev
000c8af989 kdeui: remove unused date and time related widget classes
some of the classes date back to 2001 and 2002, still unused

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-23 02:48:22 +03:00
Ivailo Monev
f2f37377e3 kdecore: reimplement KTimeZone
simpler, cleaner and most importantly - thread-safe (more than the
previous implementation anyway).

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-22 03:53:20 +03:00
Ivailo Monev
f452e2e50b kdecore: reimplement KDateTime via QDateTime
KDateTime shall be used only for storing date and time while KLocale
shall be used to display such, not even going to test what KDateTime
does because it is basically a few methods on top of QDateTime now.

and because QDateTime knows not much about calendar systems while
KLocale supports several it makes sense for KDateTime to not be used for
displaying date and time thus the TODOs for KLocale are simply removed

note that KLocale still uses its own parser and formatter which means
that the change affects only KDateTime and its uses, not KLocale

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-21 07:51:13 +03:00
Ivailo Monev
b5844bda01 kdeui: KColorDialog::KColorDialogPrivate::setHtmlEdit() optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-17 05:45:54 +03:00
Ivailo Monev
a7654dc3db kdeui: remove redundant _KDE_NET_WM_FRAME_STRUT atom and checks for it
see the following commit in kde-workspace:
0417ee37990d43a20d1c1ce05aeb213d2c1866f6

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-16 21:18:18 +03:00
Ivailo Monev
7c2e6741b6 kdeui: remove redundant Q_WS_X11 guard
KStartupInfo is not declared only when Q_WS_X11 is defined, altough it
works only on X11

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-13 19:14:02 +03:00
Ivailo Monev
abbf3f3930 kdeui: call KUniqueApplication::newInstance() on the interface when already running
so it was not called when "nofork" option was passed? hmm..

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-13 19:10:45 +03:00
Ivailo Monev
1bd5eb7d08 kdeui: remove duplicate header inclusion
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-13 18:18:35 +03:00
Ivailo Monev
e583beafbf kdeui: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-13 18:10:23 +03:00
Ivailo Monev
cd8ab8d93e kdeui: do not fork from KUniqueApplication
simplifies startup notification for example, external applications that
pass the "nofork" argument may fail (not uncommon to be passed to
konsole)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-13 17:32:37 +03:00
Ivailo Monev
0e56bc6115 kdeui: remove unused KApplicationPrivate member
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-13 16:48:12 +03:00
Ivailo Monev
982f2446bb kdeui: remove unused clipboard synchronizer
disabled by default, the KGlobaSettings signal is not emitted by
anything either

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-13 06:44:40 +03:00
Ivailo Monev
4b134fbb77 kdeui: remove krichtexteditor application
manual test..

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-13 06:32:20 +03:00
Ivailo Monev
94199903d9 kdeui: remove unused KBreadcrumbSelectionModel, KCheckableProxyModel and KIdentityProxyModel classes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-13 06:11:22 +03:00
Ivailo Monev
4ed10bdd76 kdeui: do not change the KDialog size on details widget visibility change
because the details widget may be shown, the dialog manually resized and
when the details widget is hidden the manually set size gets overriden -
the dialog size should remain the same after manual resize!

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-12 20:47:47 +03:00
Ivailo Monev
b4fc8cf48b kdeui: remove unused KVBox member and update its documentation
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-10 19:39:19 +03:00
Ivailo Monev
3fdb845769 kutils: multi-backend knetworkmanager implementation
essentially moving my code from the old networkstatus module, see the
following commits in the kde-workspace repo:
809b90a113bb559a94266464e03cba6f0ed197ae
c46a5297cc49bf4f19f81ee109833fb0abab9a99
3e01d82f44bf587251455368f7502e9e4e204176

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-08 21:10:54 +03:00
Ivailo Monev
c1456e739a kdeui: update internal KTitleWidget widgets on font change event
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-07 20:12:24 +03:00
Ivailo Monev
937f116b5f kdeui: change the palette of internal KTitleWidget widgets
mixing style sheet and palette changes is documented to be quircky, note
that the style sheet of the comment label was not reset back to normal
when the message type was changed to KTitleWidget::PlainMessage.

on a side note QPalette::Foreground (or the color style sheet property) and
QPalette::WindowText are the same

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-07 20:09:17 +03:00
Ivailo Monev
6e033933c7 kdeui: do not animate the KMessageWidget show/hide
without the slow snapshot-based rendering 500ms animation does not even
make a difference..

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-07 17:56:40 +03:00
Ivailo Monev
99a57832a1 kdeui: correct placeholder in KMessageWidget::setMessageType()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-07 08:12:33 +03:00
Ivailo Monev
c32db57584 kdeui: animate the height of KMessageWidget from KMessageWidget::animatedHide()
can animate the opacity too but size change animation suits better a
message widget that is not dialog, still it happens in 500ms and renders
much faster than the previous snapshot-based approach so..

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-07 08:03:42 +03:00
Ivailo Monev
8bf6e8bd73 kdeui: do not specify margin for the label of KMessageWidget
there is no inner frame now

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-07 07:51:47 +03:00
Ivailo Monev
0ba71250e0 kdeui: essentially KMessageWidget rewrite
the fixed size policy causes all sort of trouble, no more tho. also the
buttons will be centered now when word wrapping is on

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-07 05:57:48 +03:00
Ivailo Monev
85205ccecf kio: log KRecentDirs and KRecentDocument actions
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-03 11:28:00 +03:00
Ivailo Monev
a6ffb2dbc0 kdeui: remove unused KPixmapRegionSelectorWidget and KPixmapRegionSelectorDialog classes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-03 07:23:23 +03:00
Ivailo Monev
ee0d50c901 generic: purge most manual tests
long overdue, have no use for them

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-03 07:03:28 +03:00
Ivailo Monev
55458f706c kfile: purge KDirSelectDialog
that way file and directory dialogs will be consistent, not to mention
there were things that KDirSelectDialog was lacking such as resizable
places area.

more changes are needed to account for the directory mode
(KFile::Directory), currently for directory only mode the filter is set
to "All Folders" but it can be changed (the filter widget is not
disabled). also when an attempt to open non-existing directory by name
(via the name input widget) the error says "the file cannot be found"
- it should be "the directory cannot be found" for directory mode

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-03 03:25:54 +03:00
Ivailo Monev
45658d0d7c kdeui: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-29 18:20:49 +03:00
Ivailo Monev
b600997970 kdeui: initialize KTipDatabase::Private member
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-29 08:38:58 +03:00
Ivailo Monev
1955668732 kdeui: do not look for tip icons in <prefix>/share/kdewizard/pics
nothing installs icons there

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-29 05:57:44 +03:00
Ivailo Monev
aaeaa0a20c kdeui: remove empty KReplaceDialog code examples
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-29 05:54:22 +03:00
Ivailo Monev
01d26adc48 kdeui: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-29 05:53:43 +03:00
Ivailo Monev
6a60f0d43a kdeui: remove redundant RegExpAction and PlaceHolderAction members
QAction has a text() method which will return the same string (the
string passed to the QAction constructor)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-29 05:37:47 +03:00
Ivailo Monev
1f67d424e7 kdeui: initialize variable in KDialogQueue::Private::slotShowQueuedDialog()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-29 04:03:57 +03:00
Ivailo Monev
e555f8ce9b kdeui: initialize KDialogQueue::Private member in its constructor
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-29 04:01:20 +03:00
Ivailo Monev
77046eb641 kdeui: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-29 03:47:30 +03:00
Ivailo Monev
4e98703f75 kdeui: KDialog::setCaption() optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-29 03:28:24 +03:00
Ivailo Monev
82bbcf9b77 kdeui: remove deprecated KDialog methods
KDialog::updateGeometry() hides the QWidget::updateGeometry() method that
actually does something

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-29 03:02:31 +03:00