quassel.git
5 years agocommon: Fix BufferViewConfig upgrade defaults
Shane Synan [Thu, 12 Jul 2018 01:13:22 +0000 (20:13 -0500)]
common: Fix BufferViewConfig upgrade defaults

Fix initialization of default values when upgrading BufferViewConfig.
This solves the issue of showSearch() being set to true on upgrade
despite having the default of false.

Search doesn't usually need shown as the activate shortcut will make
it temporarily appear.

Details: When loading a buffer from configuration, the
"fromVariantMap(properties);" path was taken.  As this side lacked
the initialization, defaults weren't set for newly-added values.

Thankfully, it really is just this simple (fingers crossed).

Add some documentation love, too.

5 years agoclient: /list automatically requests channel list
Shane Synan [Fri, 22 Jun 2018 01:56:14 +0000 (20:56 -0500)]
client: /list automatically requests channel list

When using "/list" or "/list <params" to open Channel List dialog,
automatically request the channel list.  This mimics the behavior
before the UI interception and minimizes effort needed to use the
dialog.

5 years agoclient: Set Channel List input focus, sort A-Z
Shane Synan [Fri, 22 Jun 2018 01:46:54 +0000 (20:46 -0500)]
client: Set Channel List input focus, sort A-Z

Set Channel List input focus to reasonable defaults.  When advanced
channel search is visible, focus it.  Otherwise, focus the channel
list filter box.

Sort channel list by name in ascending order by default.  Sort order
can be changed afterwards as before.

5 years agoclient: Convert /list #chan to UI advanced search
Shane Synan [Fri, 22 Jun 2018 01:44:50 +0000 (20:44 -0500)]
client: Convert /list #chan to UI advanced search

Pass "/list" parameters to ChannelListDlg when opening, allowing for
"/list #channel", <Enter> to search in a similar fashion to current
stable release.

Add documentation to the showChannelList()/related functions.

Prompt when "/list" is called without a valid network selected.  This
fixes running "/list" before any networks are selected resulting in a
channel list dialog that wouldn't do anything.

5 years agologger: Refactor the logging framework
Manuel Nickschas [Wed, 20 Jun 2018 23:36:27 +0000 (01:36 +0200)]
logger: Refactor the logging framework

* Rename the previous Logger class to LogMessage (since that is what
  it is), and consolidate logging functionality, including the
  various output methods, setup of log file etc., into a new
  Logger class.

* Hold the "debug log", i.e. the collected log messages, in the Logger
  class instead of in the Client. Adapt the DebugLogWidget accordingly.
  Messages will not be kept in quasselcore, as we wouldn't have a way
  to display them otherwise (and we don't want to accumulate lots of
  data over months of the core running).

* Support early log messages. Instantiate the Logger right at the
  start of main(), and keep all log messages until the Quassel class
  is initialized and we can rely on command-line options to configure
  backends accordingly. Accumulated messages will be output once the
  Logger is configured.

5 years agoqtui: Remove bogus Quassel instance
Manuel Nickschas [Tue, 10 Jul 2018 23:40:41 +0000 (01:40 +0200)]
qtui: Remove bogus Quassel instance

A remnant from refactoring, QtUiApplication carried a useless
attribute of type Quassel. This would of course create a second
instance of the singleton, which is not a Good Thing™.

Remove the bogus attribute to ensure that Quassel is only created
once.

5 years agoclient: Fix settings upgrade missing some steps
Shane Synan [Fri, 22 Jun 2018 05:18:09 +0000 (00:18 -0500)]
client: Fix settings upgrade missing some steps

Remove cache check in Settings::localKeyExists().  This fixes
settings version upgrade wrongly skipping some steps due to earlier
migration steps causing default values (not stored in .conf) to be
loaded into settings cache.  Most notably, creating/writing the
QtUiStyle settings Qt StyleSheet.

The symptoms are only visible when migrating multiple steps at once,
hence not catching this earlier.

Bug originally introduced in d2ac8f78a0e050d2efa397c434b249d6b3391576

5 years agoqtui: Remove remnant from debugging icon loading
Manuel Nickschas [Thu, 21 Jun 2018 20:16:43 +0000 (22:16 +0200)]
qtui: Remove remnant from debugging icon loading

Good old eye...

5 years agoquassel: Install signal handlers in init() rather than ctor
Manuel Nickschas [Wed, 20 Jun 2018 20:12:25 +0000 (22:12 +0200)]
quassel: Install signal handlers in init() rather than ctor

Unix signal handlers require e.g. command line options, which are
not available at construction time of the Quassel instance.
Move signal handler registration into init().

Add TODO comments to remind us of the fact that we're not supposed
to use unsafe methods in signal handlers (which we currently do),
and should rework signal handling to be safe.

5 years agoclient: Use sentence case for Core Info details
Shane Synan [Wed, 20 Jun 2018 09:05:10 +0000 (04:05 -0500)]
client: Use sentence case for Core Info details

Use sentence case for CoreSessionWidget `Version date:` and
`Connected since:`, providing consistency with the core information.

Use sentence case for `Connected clients:`, too.

`Version date:` was the inconsistent one by majority, but (in my
subjective opinion) it looks nicer.

5 years agocommon: Make CommitDate Unix epoch, handle legacy
Shane Synan [Wed, 20 Jun 2018 09:05:00 +0000 (04:05 -0500)]
common: Make CommitDate Unix epoch, handle legacy

Leave CommitDate (BuildDate) in Unix epoch format, converting it on
demand when displayed.  This allows clients to localize the time
shown.

Add tryFormatUnixEpoch, which checks a string for Unix epoch, parsing
as date/time if possible, otherwise letting the string through.  This
avoids breaking protocol or any existing packaging scripts that set
commit date to a string.

Check for empty commit/build dates when using them, replacing with
"Unknown date" or "unknown" as appropriate.  Don't encode this in
Quassel::setupBuildInfo() to allow for location-specific treatment
and client-side translation.

5 years agoFix default port for integrated ident daemon
Michael Marley [Tue, 19 Jun 2018 16:45:44 +0000 (12:45 -0400)]
Fix default port for integrated ident daemon

The value for the option identifier was missing, causing what was
intended to be the default value to actually become the identifier
and the default value to be undefined.  This resulted in random
ports being chosen.

5 years agocore: Fix oidentd signal connection, cleanup
Shane Synan [Tue, 19 Jun 2018 02:58:41 +0000 (21:58 -0500)]
core: Fix oidentd signal connection, cleanup

Update OidentdConfigGenerator signal connections, adding the missing
socketId added in commit 41b9d689945e784b160a25d12076600ff4b7ae90 .

This fixes a warning about signals/slots not matching up.

Thanks to @genius3000 for finding this issue!

Clean up line length and spacing while we're here.

5 years agocommon: Use UTF-8 server encoding by default
Shane Synan [Tue, 19 Jun 2018 02:37:06 +0000 (21:37 -0500)]
common: Use UTF-8 server encoding by default

Switch to UTF-8 as default codec for server.  This fixes non-ASCII
characters in /away messages and other situations silently being
converted to question marks.

Don't modify default Decoding codec as UTF-8 is automatically used
there when needed.

Update tooltips to offer guidance on restoring server encoding.

NOTE 1:  If client is upgraded without core being upgraded, client
will wrongly show UTF-8 as the default for server encoding.  The
older core still uses the past encoding, and manually specifying
UTF-8 as the selected encoding still works.

NOTE 2:  This affects all networks that have not yet set a custom
encoding.  A migration would require core-side in-database settings
versioning and reading/writing from database.  It might be better to
mention this on the release notes.

This is a matter of trade-offs.  Invalid encoding can result in error
messages or server disconnecting, confusing but noisy.  However, too
limited of an encoding simply silently converts characters to
question marks, in e.g. /away messages or nicks.  No warnings are
printed.

Is the IRC world ready for UTF-8 by default as a server encoding?

Well.. that's hard to say.  This can be overridden per-network
(even with an old client!), and this commit is also easily reverted.
It's probably worthwhile trying in beta, reverting before release if
too many things break.  IRC servers should at least provide error
messages.

(I personally think it's time to switch.  Partially since it took me
 1-2 years before finding out this is why I couldn't join UTF-8
 channels on a certain network.  And it's still confusing people
 today with e.g. non-ASCII in /away messages.)

Thanks to @disconsented for bringing this issue to attention again.

Test results for Freenode (a partially UTF-8 server network):
> Before
/join ##test♪
[8:18:31 pm] --> digitalcircuit (...) has joined ##test?
/nick digitalcircuit♪
[8:19:06 pm] * No free and valid nicks in nicklist found. use: /nick <othernick> to continue
[8:19:06 pm] * Nick digitalcircuit? contains illegal characters
/away Now playing ♪ Songs to Test
[8:21:11 pm] * You have been marked as being away
/whois digitalcircuit
[8:21:18 pm] * [Whois] digitalcircuit is away: "Now playing ? Songs to Test"

> After
/join ##test♪
[8:16:57 pm] * 479 ##test♪ Illegal channel name
/nick digitalcircuit♪
[8:17:39 pm] * No free and valid nicks in nicklist found. use: /nick <othernick> to continue
[8:17:39 pm] * Nick digitalcircuit�� contains illegal characters
/away Now playing ♪ Songs to Test
[8:21:46 pm] * You have been marked as being away
/whois digitalcircuit
[8:22:12 pm] * [Whois] digitalcircuit is away: "Now playing ♪ Songs to Test"

5 years agoPrepend current nickname if buffer has no name
Matt Schatz [Thu, 29 Mar 2018 12:14:39 +0000 (06:14 -0600)]
Prepend current nickname if buffer has no name
If the buffer name is blank, assume Status Buffer (or otherwise
some un-named buffer?) and prepend our current nickname. Now
shortcuts like '/mode +R' will work on ourself from the Status
Buffer and doesn't interfere with current behaviour otherwise.

5 years agoUpdate my AboutData entry
Matt Schatz [Tue, 19 Jun 2018 00:55:39 +0000 (18:55 -0600)]
Update my AboutData entry

5 years agoclient: Fix text format shortcuts edge case
Shane Synan [Tue, 19 Jun 2018 00:59:05 +0000 (19:59 -0500)]
client: Fix text format shortcuts edge case

When toggling text formatting via keyboard shortcuts, always update
the button state, too.  This fixes an issue where in certain
situations formatting could not be removed by shortcut, only by
button.

(I originally avoided doing this out of concern it'd create a loop
 with the clicked() signal firing when setting check state.
 Thankfully that's not the case.)

Test case:

1.  Type "test message here"
2.  Select "message", mark as italic (button or shortcut)
3.  Move cursor to end of message, so italic button becomes unpressed
4.  Click at the end of the word "message" (after the 'e'), and
    drag-select/Shift-Arrow select up to the beginning of the message
    (before the 'm').
5.  Use shortcut to toggle italic, several times
6.  Use button to toggle italic, several times

> Before
The italic shortcut would not toggle on then off, clearing the format
> After
The italic shortcut works after toggling twice, just like the button.

Having to toggle twice in this situation is a bug that existed before
the formatting shortcut changes.

5 years agoaboutdata: Rename QuasselDroid -> Quasseldroid
Shane Synan [Tue, 19 Jun 2018 00:12:33 +0000 (19:12 -0500)]
aboutdata: Rename QuasselDroid -> Quasseldroid

Update @justJanne 's contributor information to mention
"Quasseldroid" instead of "QuasselDroid".  This matches upstream
rebranding to reduce the risk of a lawsuit from certain companies
involved with things called "Droid".

The other mention of "QuasselDroid" is from sandsmark, where the
project is still called "QuasselDroid" (and now marked as legacy).
It may be better to leave that one to distinguish the projects.

See https://git.kuschku.de/justJanne/QuasselDroid-ng/commit/5e08f048764171d550ce17127c4075709bf9c2cd

5 years agoclient: Poll legacy CoreInfo when dialog is open
Shane Synan [Mon, 18 Jun 2018 21:13:36 +0000 (16:13 -0500)]
client: Poll legacy CoreInfo when dialog is open

On legacy cores (lacking SyncedCoreInfo), when CoreInfoDlg is open,
every 15 seconds resynchronize CoreInfo object to update the
"Connected Clients" count.  This matches expectations set by the
counting uptime clock, and shouldn't be a significant data impact as
info is only polled while the dialog is open.

Modern cores (with SyncedCoreInfo) will not poll, using signals to
update immediately as before.

5 years agoclient: Detect legacy CoreInfo, request on show
Shane Synan [Mon, 18 Jun 2018 21:16:37 +0000 (16:16 -0500)]
client: Detect legacy CoreInfo, request on show

Add feature flag 'SyncedCoreInfo' to signify the core supports
signals for the CoreInfo object.

Detect cores without support for 'SyncedCoreInfo', and poll for core
information on every CoreInfoDlg show.  This avoids regressing
functionality for older cores.

Synchronize the CoreInfo object before connecting, ensuring it's
ready to receive parameters on first connect, mimicking backlog
requester.  This avoids a warning about "No registered receiver"
for the CoreInfo handler.

Reset CoreInfo object on disconnect, update CoreInfoDlg with
"Disconnected from core" message.  This reduces confusion about the
state of the core; before, it would simply stop updating.

Remove several nullpointer checks, CoreInfo now should never be null.

Add Client::coreInfoResynchronized() signal for CoreInfo
resynchronization, allowing for periodic updates on legacy cores.

5 years agocore: Silence auto-PINGs with invalid timestamps
Shane Synan [Mon, 18 Jun 2018 20:47:10 +0000 (15:47 -0500)]
core: Silence auto-PINGs with invalid timestamps

Track whether or not an automated ping reply is pending.  If so, and
if the network has not shown to reply to PING via quoting, silence
the response.

This fixes automated PING resulting in unsolicited PONG replies
spamming the server buffer for networks that don't quote PING in
PONG replies.  Manual PING still works in almost all cases, unless
the IRC server responds out-of-order.

Mark a network as sending valid PONG timestamps after the first one
is received, resetting on every connect (as each server may differ).

Simplify PONG silencing by using the EventManager::Silent flag,
remove redundant logic from EventStringifier.

Clean up private variable initialization.

5 years agocore: Handle single-parameter PONG replies
Shane Synan [Mon, 18 Jun 2018 03:50:01 +0000 (22:50 -0500)]
core: Handle single-parameter PONG replies

In processIrcEventPong, allow for single-parameter PONG replies.
Some IRC servers reply with server name then quote, others reply with
just the quote.

Log a debug message for invalid timestamps.  It's not a known error
as the user can request arbitrary PING replies, but it should be
logged to simplify tracking down IRC servers that mangle or outright
ignore the PING parameters.

(Yes, some IRC servers do this.)

Handle single-parameter PONG replies in EventStringifier, too.

Clarify and reformat comments.

5 years agoClean up the HighlightRuleManager a bit
Manuel Nickschas [Mon, 18 Jun 2018 20:37:23 +0000 (22:37 +0200)]
Clean up the HighlightRuleManager a bit

Fix formatting and const-correctness.

5 years agoRework sync protocol for highlight rules
Janne Koschinski [Sun, 10 Jun 2018 22:50:09 +0000 (00:50 +0200)]
Rework sync protocol for highlight rules

- Sync highlightNick and nicksCaseSensitive as actual Q_PROPERTY
- Identify rules by their id, not their name
- This allows multiple rules to have the same rule, but different scopes
  and senders

5 years agoicons: Override system icon theme by default
Manuel Nickschas [Mon, 18 Jun 2018 21:04:30 +0000 (23:04 +0200)]
icons: Override system icon theme by default

Preliminary reports from the field are in, and apparently the
fallback theme handling is too fragile to unleash it onto
unsuspecting users, due to bugs in Qt, desktop environments and
just plain stupid desktop themes.

Override by default to get a consistent look of Quassel in most
cases. Users can still actively choose the other way.

5 years agoclient: Fix Remote Cores marked unsaved on load
Shane Synan [Mon, 18 Jun 2018 01:02:49 +0000 (20:02 -0500)]
client: Fix Remote Cores marked unsaved on load

Fix Remote Cores (CoreAccountSettingsPage) wrongly being marked as
unsaved when loading if a default core account was chosen and the
index in the QComboBox was not 0.

This likely happened due to the change of setCurrentIndex on
autoConnectAccount triggering the state as changed, due to a missing
call to setChangedState().  Possibly.

Also clean up if statement scopes while we're here.

Test case:
> Add two accounts, "A" and "B"
> Pick "B" as default account
> Save, close Settings dialog, re-open
> Select Remote Cores, note that it's treated as if changes were there

5 years agoclient: Clean up CoreAccount, add qDebug support
Shane Synan [Mon, 18 Jun 2018 00:17:21 +0000 (19:17 -0500)]
client: Clean up CoreAccount, add qDebug support

Clean up CoreAccount and CoreAccountModel, adding support for the
negated equality operator '!=' and qDebug() printing.

Modify CoreAccountSettingsPage::testHasChanged() to make use of the
negated equality operator.

5 years agoidentd: Remove unneeded strict attribute
Manuel Nickschas [Mon, 18 Jun 2018 18:19:26 +0000 (20:19 +0200)]
identd: Remove unneeded strict attribute

Strictness is now handled in CoreSession, so the attribute is no
longer used.

5 years agoidentd: Ensure sockets are deleted when disconnected
Manuel Nickschas [Sun, 17 Jun 2018 22:07:51 +0000 (00:07 +0200)]
identd: Ensure sockets are deleted when disconnected

Don't leave stale sockets around; instead, have them delete themselves
once disconnected. Use a QPointer in Request to be able to check for
deletion before trying to access the socket.

5 years agoidentd: Cleanup
Manuel Nickschas [Sun, 17 Jun 2018 22:03:25 +0000 (00:03 +0200)]
identd: Cleanup

Fix formatting and const-correctness.

5 years agoidentd: Return INVALID-PORT if the parsing fails
Jan Alexander Steffens (heftig) [Sat, 19 May 2018 10:47:02 +0000 (12:47 +0200)]
identd: Return INVALID-PORT if the parsing fails

5 years agoidentd: Move response construction to Request
Jan Alexander Steffens (heftig) [Sat, 19 May 2018 10:31:40 +0000 (12:31 +0200)]
identd: Move response construction to Request

5 years agoidentd: Rework lowestSocketId handling
Jan Alexander Steffens (heftig) [Sat, 19 May 2018 10:31:40 +0000 (12:31 +0200)]
identd: Rework lowestSocketId handling

Since we're appending only strictly increasing integers, the lowest
socketId is always at the front of the list (if that exists).

hasSocketsBelowId also had a off-by-one error. This had no effect on the
code since a socketId equal to the current _socketId cannot be in the
_waiting list.

Reorder processWaiting's handling of requests:
  - If the socketId is one the request might have been waiting for,
    check responseAvailable.
  - Otherwise, if there is at least one socket we need to wait for,
    continue waiting.
  - Otherwise, responseUnavailable.

The former order was:
  - If there are no sockets left from before this request was made,
    responseUnavailable.
  - If the socketId is one the request might have been waiting for,
    check responseAvailable.
  - Otherwise, continue waiting.

The change was necessary as the lowestSocketId no longer includes the
socketId that was just removed. In addition, the new order also matches
the if-else chain in IdentServer::respond.

5 years agoidentd: Simplify responseAvailable via early return
Jan Alexander Steffens (heftig) [Sat, 19 May 2018 10:29:43 +0000 (12:29 +0200)]
identd: Simplify responseAvailable via early return

5 years agoidentd: Flatten respond's if-else chain
Jan Alexander Steffens (heftig) [Sat, 19 May 2018 10:29:42 +0000 (12:29 +0200)]
identd: Flatten respond's if-else chain

5 years agoidentd: Avoid a maybe-uninitialized warning
Jan Alexander Steffens (heftig) [Sat, 19 May 2018 10:42:48 +0000 (12:42 +0200)]
identd: Avoid a maybe-uninitialized warning

5 years agoidentd: Turn !canReadLine into an early return
Jan Alexander Steffens (heftig) [Sat, 19 May 2018 10:29:42 +0000 (12:29 +0200)]
identd: Turn !canReadLine into an early return

Reduces rightward drift.

5 years agoidentd: Implement --ident-port option
Janne Koschinski [Tue, 8 May 2018 15:44:25 +0000 (17:44 +0200)]
identd: Implement --ident-port option

5 years agoidentd: Implement blocking request queueing
Janne Koschinski [Mon, 7 May 2018 23:49:13 +0000 (01:49 +0200)]
identd: Implement blocking request queueing

5 years agoidentd: Initial draft of integrated ident daemon
Janne Koschinski [Mon, 7 May 2018 22:12:32 +0000 (00:12 +0200)]
identd: Initial draft of integrated ident daemon

5 years agoqtui: Fix typo
Manuel Nickschas [Mon, 18 Jun 2018 06:46:20 +0000 (08:46 +0200)]
qtui: Fix typo

5 years agoclient: Use QT_VERSION for 'enum class' fallback
Shane Synan [Sun, 17 Jun 2018 19:30:33 +0000 (14:30 -0500)]
client: Use QT_VERSION for 'enum class' fallback

Use QT_VERSION macro for 'enum class' fallback, making it much
simpler to clean up the Qt4 code once the migration happens.

5 years agodocs: Move SQL schema to README.md, add more help
Shane Synan [Sun, 17 Jun 2018 19:25:39 +0000 (14:25 -0500)]
docs: Move SQL schema to README.md, add more help

Move SQL schema guidelines to a dedicated README.md, with all the
niceties of Markdown formatting and the added prominence of GitHub
displaying it whenever navigating to the `src/sql` folder.

Add a brief high-level overview of Quassel's database schema.

Polish up the SQL schema guidelines to follow the current Quassel
workflow.

Clean up remarks in the script files, including pointing to the new
README.md file.

5 years agodocs: Revert '–' to '--' in root README.md
Shane Synan [Sun, 17 Jun 2018 17:38:12 +0000 (12:38 -0500)]
docs: Revert '–' to '--' in root README.md

Revert to '--' in root README.md instead of Unicode '–'.  The former
is easier to distinguish in monospace text environments.

5 years agoqtui: Fix typo in #ifdef
Manuel Nickschas [Sun, 17 Jun 2018 17:32:11 +0000 (19:32 +0200)]
qtui: Fix typo in #ifdef

5 years agoicons: Don't offer the Oxygen fallback if not enabled in CMake
Manuel Nickschas [Sun, 17 Jun 2018 14:01:11 +0000 (16:01 +0200)]
icons: Don't offer the Oxygen fallback if not enabled in CMake

If -DWITH_OXYGEN_ICONS is disabled, Quassel will not install its
own Oxygen icons, and thus those would be missing if Oxygen were
chosen as a fallback.

Ensure that the fallback isn't offered in this case even if there
happens to be a (runtime-detected) system installation of Oxygen.

5 years agoicons: Update icons/README.md to match reality
Manuel Nickschas [Sun, 17 Jun 2018 13:59:07 +0000 (15:59 +0200)]
icons: Update icons/README.md to match reality

5 years agoicons: Update bundled icon themes
Manuel Nickschas [Sun, 17 Jun 2018 12:36:37 +0000 (14:36 +0200)]
icons: Update bundled icon themes

Adapt to the changes in the previous commit.

5 years agoicons: Warn on missing icons
Manuel Nickschas [Sun, 17 Jun 2018 11:39:25 +0000 (13:39 +0200)]
icons: Warn on missing icons

Provide new helper functions icon::get() that replace the uses of
QIcon::fromTheme. These functions still use fromTheme() internally,
but log a warning if an icon could not be found. This should make
it easier to detect problems with icons.

Replace all uses of QIcon::fromTheme() with icon::get(), remove
useless fallbacks as that should be taken care of by the normal
icon loader mechanism.

Update the icon import script accordingly.

5 years agodocs: Simplify README.md, add help, downloads
Shane Synan [Sun, 17 Jun 2018 04:27:25 +0000 (23:27 -0500)]
docs: Simplify README.md, add help, downloads

Add more guidance to README.md, namely the use of `--help`.

Add a section on downloads, pointing to the official download page,
automated builds, and community-contributed builds.

Move the status badges to a new line, simplifying the header
appearance.

Clean up the URLs with Markdown references, add the "Windows: " text
to AppVeyor builds to distinguish it from Linux.  Travis CI
unfortunately does not allow for a similar customization.

Replace "--" with "–", a Unicode replacement that should match the
intent.

Replace ```triple-backticks``` with `single-backticks`; both function
correctly and the latter is less annoying to read as plain text.

Fix bullet list indentation.

See https://docs.travis-ci.com/user/status-images/
And https://www.appveyor.com/docs/status-badges/

5 years agoExclude ignored messages in Away Log
Svetlana Tkachenko [Wed, 31 Jan 2018 23:11:35 +0000 (23:11 +0000)]
Exclude ignored messages in Away Log

Cleaned-up-by: Manuel Nickschas <sputnick@quassel-irc.org>
5 years agocmake: Enable ccache by default, if available
Manuel Nickschas [Sat, 16 Jun 2018 19:58:51 +0000 (21:58 +0200)]
cmake: Enable ccache by default, if available

Check for the existence of the ccache binary, and enable ccache
support if available. This avoids the need for hacks using PATH
or the CXX variable to make ccache work.

The automatic detection can be disabled by passing -DUSE_CCACHE=OFF
to CMake (may be useful for distributors having their own ccache
infrastructure in place).

Reorder things in the top-level CMakeLists.txt a bit, because ccache
should be enabled before calling project() (which checks compiler
settings).

5 years agoclient: UiStyle.h use "enum" for Qt4, cleanup
Shane Synan [Sat, 16 Jun 2018 18:17:59 +0000 (13:17 -0500)]
client: UiStyle.h use "enum" for Qt4, cleanup

Use "enum" instead of "enum class" for Qt4 support in Q_ENUMS, adding
a comment about switching back later.

Update Doxygen comments to properly associate to the previous line
via "///<" intead of "///".

5 years agoclient: Remove unused highlight UI translations
Shane Synan [Sat, 16 Jun 2018 17:12:09 +0000 (12:12 -0500)]
client: Remove unused highlight UI translations

Mark the highlightImport text and tooltip in
CoreHighlightSettingsPage as no translate, and make it obvious this
text is replaced at runtime.

Let Qt Creator do its formatting thing, updating the UI width and
indentation.

5 years agoclient: Clean up chatviewsettingspage.ui
Shane Synan [Sat, 16 Jun 2018 17:10:00 +0000 (12:10 -0500)]
client: Clean up chatviewsettingspage.ui

Clean up the HTML spew from the Rich Text editor for
senderPrefixComboBox, using handcrafted Qt markup to simplify it for
translators.  (Hopefully.)

CAUTION: Editing the tooltip in Qt's Rich Text editor will convert it
back to HTML.  Use the Source view of the editor.

Use <number> instead of <bool> for custom enumeration values.  This
stops Qt Creator from converting it to "false" when loading the file.

5 years agoclient: ChatViewSettings check before reload Qss
Shane Synan [Thu, 14 Jun 2018 05:33:41 +0000 (00:33 -0500)]
client: ChatViewSettings check before reload Qss

Check if Qt stylesheet needs regenerating before regenerating and
reloading the stylesheet, only doing it if the font settings change.
Everything else doesn't modify the stylesheet, speeding up changing
those settings when font is not changed.

5 years agoclient: Highest sender prefix mode, migrate, fix
Shane Synan [Thu, 14 Jun 2018 04:58:48 +0000 (23:58 -0500)]
client: Highest sender prefix mode, migrate, fix

Add a "Highest mode" for showing sender prefixes, to only show the
highest in a given situation.  This mimics most IRC clients,
including Quasseldroid, while still saving the full mode details
behind the scenes.

Switch the UI from a Checkbox to a ComboBox, with all the 'fun' of
enums in Qt.  (Tip: don't code when tired.)

Add settings migration to preserve "None" for people upgrading, so
they won't suddenly see changes.

NOTE:  0.13 master users will need to opt in to enable showing sender
prefixes again.  A migration could be added, but the checkbox has
never been in beta or stable...

Fix up the "enableSenderBrackets" fallback default to be false, as
per Quassel itself.

Fix the sender prefix feature check to use "SenderPrefixes" instead
of "CoreSideHighlights".

5 years agoclient: add FontSelector SettingsPage::hasChanged
Shane Synan [Thu, 14 Jun 2018 03:45:41 +0000 (22:45 -0500)]
client: add FontSelector SettingsPage::hasChanged

Add support for FontSelector in SettingsPage::hasChanged(), allowing
one to easily test if a specific font selector has changed since last
save.

This allows for optimizing stylesheet updates to only happen when
relevant settings are changed.

5 years agoclient: Fix SettingsPage::hasChanged() failure
Shane Synan [Thu, 14 Jun 2018 03:36:28 +0000 (22:36 -0500)]
client: Fix SettingsPage::hasChanged() failure

Fix SettingsPage::hasChanged() to compare with the correct property,
"storedValue", instead of "StoredValue".  This resulted in the
settings page sometimes errantly marking values as not changed when
they were, or vice-versa.

Some settings pages could probably be cleaned up now that this is
fixed.  That is left for future cleanup efforts.

5 years agoclient: Fix settings migration fallthrough
Shane Synan [Thu, 14 Jun 2018 03:32:55 +0000 (22:32 -0500)]
client: Fix settings migration fallthrough

Version 8 was not supposed to fall through to version 7.  Fix this.

5 years agoqtui: Fix build for KDE4
Manuel Nickschas [Sat, 16 Jun 2018 18:34:45 +0000 (20:34 +0200)]
qtui: Fix build for KDE4

5 years agoClean up High-DPI scaling options
Ken Moore [Mon, 1 May 2017 14:53:40 +0000 (10:53 -0400)]
Clean up High-DPI scaling options

Ensure the attributes are set before instantiating the application
object, slightly modify Qt version requirements.

Closes GH-293.

Mangled-by: Manuel Nickschas
5 years agomono: "Import Legacy" for import local highlights
Shane Synan [Wed, 13 Jun 2018 21:10:15 +0000 (16:10 -0500)]
mono: "Import Legacy" for import local highlights

Rename "Import Local" as "Import Legacy", and replace references to
"Local Highlights" with "Legacy Highlights" in core-side highlights
when running in monolithic mode.

This reduces confusion over where highlights are imported when
migrating highlights in Monolithic mode.

This continues clarification efforts in a previous commit,
0182f0e3977026de65be1edb6ca1e8d7ea0184fd

Only import if question message box result is Yes, instead of not No.
This reduces the risk of accidentally importing if the message box is
ever changed to give more options or if it returns other responses.

5 years agoRemove unused quassel.icns
romibi [Fri, 15 Jun 2018 09:51:28 +0000 (11:51 +0200)]
Remove unused quassel.icns

5 years agoAutogenerate icns from png iconset for app bundle
romibi [Fri, 15 Jun 2018 09:51:03 +0000 (11:51 +0200)]
Autogenerate icns from png iconset for app bundle

5 years agoclient: Update welcome logo with new logo, shadow
Shane Synan [Fri, 15 Jun 2018 20:57:21 +0000 (15:57 -0500)]
client: Update welcome logo with new logo, shadow

Update "quassel-logo.svgz" with new Quassel logo, reduce the
drop-shadow intensity.

Update "quassel-logo.png" with the revised SVG file.

Clean up "quassel-logo.svgz" using the latest Inkscape version, set
up document parameters so Export PNG -> "Page" size works.

To recreate the drop shadow in Inkscape:
1.  Select all objects
2.  In the menu, choose "Filters" -> "Remove Filters", clearing any existing shadows
3.  Select chat bubble logo
4.  In the menu, choose "Filters" -> "Shadows and Glows" -> "Drop Shadow..."
5.  In the "Options" tab, set as follows...
    > Blur radius:       2.1 px
    > Horizontal offset: 1.1 px
    > Vertical offset:   1.1 px
6.  In the "Blur color" tab, set as follows...
    > RGBA:              1c1c1c33
7.  Apply the filter
8.  Select the "Quassel IRC" text object
9.  In the menu, choose "Filters" -> "Shadows and Glows" -> "Drop Shadow..."
10. In the "Options" tab, set as follows...
    > Blur radius:       4.2 px
    > Horizontal offset: 2.1 px
    > Vertical offset:   2.1 px
11. In the "Blur color" tab, set as follows...
    > RGBA:              1c1c1c33
12. Apply the filter

To export an updated welcome logo:
1.  In the menu, choose "File" -> "Export PNG Image..."
2.  For "Export Area", choose "Page"
3.  Export the image

5 years agoqtui: Rework the attention state behavior of the tray icon
Manuel Nickschas [Thu, 14 Jun 2018 22:59:15 +0000 (00:59 +0200)]
qtui: Rework the attention state behavior of the tray icon

Move the attention behavior handling into the SystemTray base class,
which now determines the correct icon names to display based on
the tray state and notification settings. Systray implementations
now just react on signals from the base class to update their
icons accordingly.

Extend the systray notification settings to allow for a more fine-
grained configuration. Users can now choose if the tray should be
alerted at all, and if so, if the tray icon should change color or
even blink instead of relying on the visualizer's default.

This now works with both StatusNotifierItem and the legacy tray.

Supersedes and closes GH-327.

5 years agoqtui: Fix duplication of tray icon with StatusNotifier
Manuel Nickschas [Thu, 14 Jun 2018 22:55:07 +0000 (00:55 +0200)]
qtui: Fix duplication of tray icon with StatusNotifier

Don't register a custom D-Bus service for the StatusNotifierItem.
Instead, just use the base service that is already registered.

Fixes the duplication of the tray icon that sporadically happened
with Plasma's SNI visualization, which sometimes forgot to properly
track the custom service name.

5 years agoqtui: Hide "fallback" and "Override" if no system theme is configured
Manuel Nickschas [Thu, 14 Jun 2018 19:47:26 +0000 (21:47 +0200)]
qtui: Hide "fallback" and "Override" if no system theme is configured

On platforms that don't support icon themes, it does not make sense
to show related options in appearance settings.

Hide the override option in that case, and change wording from
"Fallback icon theme" to just "Icon theme".

5 years agoqtui: Don't show config for DockManager if not available
Manuel Nickschas [Thu, 14 Jun 2018 19:13:41 +0000 (21:13 +0200)]
qtui: Don't show config for DockManager if not available

Instead of just disabling the checkbox for DockManager notifications,
hide the config widget if the D-Bus service is not available.
Otherwise it's really confusing to see a disabled option for a
notification backend that was basically retired 6 years ago.

5 years agoqtui: Show core connection dialog only after initialization
Manuel Nickschas [Thu, 14 Jun 2018 19:12:17 +0000 (21:12 +0200)]
qtui: Show core connection dialog only after initialization

Showing a blocking dialog in init() is a bad idea, because then
initialization doesn't actually finish until the dialog is closed.
For example, this delays the setup of the tray icon.

Instead, go through the event loop before showing the initial
connection dialog.

5 years agoicons: Fix icons not showing for format color buttons
Manuel Nickschas [Thu, 14 Jun 2018 17:58:21 +0000 (19:58 +0200)]
icons: Fix icons not showing for format color buttons

Adding a menu to a button seems to clear an icon set previously
until the button is clicked. Fix this by reordering things.

5 years agoqtui: Fix tooltip and change wording in Appearance settings
Manuel Nickschas [Thu, 14 Jun 2018 17:33:38 +0000 (19:33 +0200)]
qtui: Fix tooltip and change wording in Appearance settings

Let the tooltip for "Fallback icon theme" wrap. Change the wording
from "Invert colors" to "Invert brightness", which is what the option
really does.

5 years agoqtui: Properly update tray icons
Manuel Nickschas [Wed, 13 Jun 2018 22:03:23 +0000 (00:03 +0200)]
qtui: Properly update tray icons

Refresh tray icons in case the icon theme is changed, or when
switching between normal and inverted tray icons.

5 years agoqtui: Refactor the system tray implementations
Manuel Nickschas [Wed, 13 Jun 2018 21:47:52 +0000 (23:47 +0200)]
qtui: Refactor the system tray implementations

Replace the mess of virtual methods and init() and other weird
shenanigans by a cleaner architecture. Handle mode/state changes
in the base class and let the implementations explicitly act on
changes. This should make it much clearer how the implementations
behave if mode or state change.

Simplify the D-Bus parts of StatusNotifierItem quite a bit by
keeping the SNI watcher always alive; no need to kill it when
unregistering. Add error handling to the final D-Bus registration
call and fall back to the legacy icon if something went wrong.

5 years agoicons: Add hicolor fallback for Qt < 5.5
Manuel Nickschas [Wed, 13 Jun 2018 20:57:37 +0000 (22:57 +0200)]
icons: Add hicolor fallback for Qt < 5.5

Turns out that Qt only added support for split icon themes in 5.5,
so with older Qt versions our icon theme support doesn't work
properly.

Install hicolor icons for Qt < 5.5, as we already do for Qt 4.
Add a hicolor icon resource, too, and make use of it in the system
tray implementations, which is arguably the most important place
to have proper icon support.

This adds around 130 KiB to the binary size, but should save a lot
of headaches.

5 years agoqtui: Switch to tray-specific icons
Manuel Nickschas [Tue, 12 Jun 2018 20:56:59 +0000 (22:56 +0200)]
qtui: Switch to tray-specific icons

Change icon names for the system tray to use the tray-specific
icons. Add support for inverted colors, too.

5 years agoqtui: Use icon names in tray implementations
Manuel Nickschas [Tue, 12 Jun 2018 20:00:01 +0000 (22:00 +0200)]
qtui: Use icon names in tray implementations

Instead of keeping QIcon instances in the base class, have a central
place to define the icon names for each state, and use that in the
implementations.

5 years agoicons: Update application icon
Manuel Nickschas [Mon, 11 Jun 2018 22:06:41 +0000 (00:06 +0200)]
icons: Update application icon

Use the ones generated by justJanne, rather than the stock version.
Looks identical.

5 years agoqtui: Clean up SystemTray
Manuel Nickschas [Mon, 11 Jun 2018 20:52:16 +0000 (22:52 +0200)]
qtui: Clean up SystemTray

Remove inlines, use override, default-initialize attributes,
reorder methods.

5 years agoicons: Fix icon theme support for StatusNotifierItem
Manuel Nickschas [Mon, 11 Jun 2018 19:07:37 +0000 (21:07 +0200)]
icons: Fix icon theme support for StatusNotifierItem

If SNI is used, the tray icons are passed along to the visualizer
by name rather than as a pixmap (the SNI protocol would support
pixmaps too, however that is a) discouraged and b) not supported
e.g. in Unity).

The SNI interface supports a more or less undocumented attribute
IconThemePath, which may contain an additional path for the
visualizer to look into for specific icons. At least Plasma and
LXQt seem to expect a hicolor theme in the given directory.

Have StatusNotifierItem create a skeleton hicolor theme containing
the tray icons in a temporary directory, and pass that along via
IconThemePath. The tray icons to be saved are dynamically determined
using the current icon theme/fallback.

All available icon sizes are saved as pixmaps; sadly, with the dynamic
approach, scalable icons cannot be supported. Alternatively, one could
hard-code the relevant .svg files from the fallback themes, and copy
those, but that would just be annoying - and kill themeability.

5 years agointerfaces: Fix types in SNI interfaces, remove old annotations
Manuel Nickschas [Wed, 6 Jun 2018 22:49:20 +0000 (00:49 +0200)]
interfaces: Fix types in SNI interfaces, remove old annotations

Not sure why, but the pixmap types in the SNI interface were all
wrong (didn't seem to cause any issues, though, for some reason...).
Fix this.

Remove old com.trolltech.QtDBus.QtTypeName annotations, which are no
longer needed in any version of Qt we still support.

5 years agoFix notification icon not appearing in Unity
Daniel Albers [Tue, 5 Aug 2014 10:36:51 +0000 (12:36 +0200)]
Fix notification icon not appearing in Unity

Unity's indicator expects certain properties to be exported by an
application, of which Quassel is lacking some. This adds IconThemePath,
Menu, ItemIsMenu to org.kde.StatusNotifierItem.

Thanks a lot to shiznix for providing this patch.

Fixes #1269

(cherry picked from commit 3939820389d995f56a073fc1d54ab245c6558312)

5 years agoicons: Install Quassel-specific icons in hicolor for Qt4
Manuel Nickschas [Mon, 11 Jun 2018 18:37:05 +0000 (20:37 +0200)]
icons: Install Quassel-specific icons in hicolor for Qt4

Qt4 sadly doesn't support split icon themes yet, so our injection
and mechanism does not work.
Install the Quassel-specific icons into hicolor, so they should be
found at least in a proper system installation. Use the Oxygen
theme, because its layout matches the hicolor one (simplifying
the install rule), and it was default for Qt4 anyway.

5 years agocmake: Clean up icon-related build options
Manuel Nickschas [Tue, 5 Jun 2018 21:20:58 +0000 (23:20 +0200)]
cmake: Clean up icon-related build options

Remove -DWITH_BREEZE, -DWITH_BREEZE_DARK and -DWITH_OXYGEN options
from CMake. Instead, provide two new options that should make things
a bit clearer:

-DWITH_BUNDLED_ICONS now controls if bundled icon themes should be
    installed/embedded. Defaults to ON to ensure that required
    icons are available unless explicitly disabled (e.g. by a
    package maintainer, who should then make sure that a dependency
    to Breeze/Oxygen exists).
    Disabling this option saves less than 2 MB of disk space.

-DWITH_OXYGEN_ICONS controls whether the Oxygen icon theme should
    still be supported. This affects both the Oxygen-themed
    Quassel-specific icons and the bundled icon theme. Defaults to
    OFF when building against Qt5, ON for Qt4.

Adapt code accordingly, and update INSTALL.

5 years agoqtui: Fix icons in the AboutDlg
Manuel Nickschas [Mon, 4 Jun 2018 20:13:12 +0000 (22:13 +0200)]
qtui: Fix icons in the AboutDlg

With the icon reorganization, no aliases are created inside resource
files anymore. Explicitly put the Breeze and Oxygen Quassel pixmaps
for the AboutDlg into pics/ and add it to the :pics/ resource.

Remove pics/quassel.png which was shipped, but not actually used
due to it missing from the resource file.

5 years agoqtui: Set proper icon for "About Quassel" menu option
Manuel Nickschas [Sun, 3 Jun 2018 23:16:01 +0000 (01:16 +0200)]
qtui: Set proper icon for "About Quassel" menu option

With the icons reorganization, we no longer have fallbacks available
on a resource path. Use QIcon::fromTheme() instead.

5 years agoqtui: Set default window icon independent of connection state
Manuel Nickschas [Sun, 3 Jun 2018 23:14:43 +0000 (01:14 +0200)]
qtui: Set default window icon independent of connection state

5 years agoqtui: Fix icon loading and improve icon theme support
Manuel Nickschas [Mon, 4 Jun 2018 22:07:01 +0000 (00:07 +0200)]
qtui: Fix icon loading and improve icon theme support

Quassel relies on quite a number of icons that are part of KDE/Plasma
icon themes such as Breeze and Oxygen, but are not specified by
freedesktop.org's Icon Naming Specification. As such, icon themes
other than the afforementioned most likely don't contain all the
icons Quassel needs.

Additionally, Quassel ships several additional icons that are not part
of any theme, but are made to fit in with Breeze/Oxygen.

In order to ensure that all required icons are available, we now
assume that at least one of Breeze, Breeze Dark or Oxygen themes is
available as a fallback, either as a system-wide installation, or by
having Quassel itself deploy the required subset in its data dir
(related build options will be adapted in a follow-up commit).

Allow the user to configure which fallback theme is to be used,
and if the system icon theme should be completely overridden (as
opposed to just filling in missing icons). If the system theme
is Breeze/Oxygen, just inject the corresponding Quassel-specific
icons. If the configured system theme doesn't match the selected
fallback (and should not be overridden), create a proxy icon theme
that inherits from first the system theme and then the selected
fallback. That way, missing icons are found through the inheritance
chain.

Note that as of Qt 5.11.0, icons from the hicolor default theme are
preferred over the ones from inherited themes, which violates the
Icon Theme Specification (cf. QTBUG-68603). This affects Quassel's
application icon, which will thus always use the Breeze variant
if a non-supported system icon theme is used. Other icons will be
picked from the selected fallback theme, as expected.

5 years agoqa: Use override in QtUi
Manuel Nickschas [Tue, 15 May 2018 22:36:44 +0000 (00:36 +0200)]
qa: Use override in QtUi

5 years agoicons: Use more common names for irc-channel-* icons
Manuel Nickschas [Tue, 15 May 2018 20:13:00 +0000 (22:13 +0200)]
icons: Use more common names for irc-channel-* icons

irc-channel-joined and irc-channel-parted are not shipped with Oxygen.
Use irc-channel-active and irc-channel-inactive instead, which are
supported by both Oxygen and Breeze (and are identical to the previous
ones in Breeze).

5 years agoicons: Fix message-quassel-tray-inverted icon
Manuel Nickschas [Mon, 4 Jun 2018 20:38:01 +0000 (22:38 +0200)]
icons: Fix message-quassel-tray-inverted icon

Use the correct base shape for this icon.

5 years agoicons: Update bundled Breeze and Breeze Dark icon themes
Manuel Nickschas [Tue, 15 May 2018 19:40:47 +0000 (21:40 +0200)]
icons: Update bundled Breeze and Breeze Dark icon themes

Update to latest upstream commit.

5 years agoicons: Adapt and improve icon import script
Manuel Nickschas [Tue, 15 May 2018 19:14:09 +0000 (21:14 +0200)]
icons: Adapt and improve icon import script

No longer require running it from inside a specific directory.
Remove theme-specific blacklists, as they are not needed anymore.
Modernize and improve the code a bit.

5 years agoicons: Remove obsolete hicolor icons
Manuel Nickschas [Mon, 14 May 2018 21:59:32 +0000 (23:59 +0200)]
icons: Remove obsolete hicolor icons

The hicolor directory should only contain the application icon
for external use. Remove other icons (which are no longer used
by Quassel anyway).

Move irc-channel-joined and irc-channel-parted into the quassel-
specific oxygen icon set, as they're not part of the upstream theme.

5 years agoicons: Reorganize icon directories
Manuel Nickschas [Mon, 14 May 2018 21:44:21 +0000 (23:44 +0200)]
icons: Reorganize icon directories

Move bundled icon themes into 3rdparty/icons for clarity. Move
Quassel-specific icons from icons/extra-icons into icons proper.
Rename breezedark to breeze-dark to match the upstream directory
name. Update corresponding qrc files accordingly.

Note that this breaks icon loading until the code is adapted to
properly support icon themes and fallback mechanisms. This will
be fixed in a follow-up commit. Since then Quassel itself will
no longer use the hicolor icons (which are only intended to contain
the application icons for use by desktop environments), there is
no need to bundle them anymore.

The import_theme.pl script also still requires adaptations that will
be delivered in a later commit.

5 years agoAdd a README to the icons folder
romibi [Sat, 17 Mar 2018 17:06:29 +0000 (18:06 +0100)]
Add a README to the icons folder

5 years agoUpdate qrc's for new Icons and update Import Script
romibi [Thu, 1 Feb 2018 22:47:30 +0000 (23:47 +0100)]
Update qrc's for new Icons and update Import Script

5 years agoUpdate Quassel-Icons based on justjannes icon-repo
romibi [Thu, 1 Feb 2018 22:42:36 +0000 (23:42 +0100)]
Update Quassel-Icons based on justjannes icon-repo

See https://github.com/justjanne/quassel-icons commit 18a8974
inkl. new slim Tray-Icons
inkl. Inverted Tray Icons (Light to Dark and vice versa)
Updated Quassel App Icon
Put Extra Icons in a separate folder in Resources/Data
Updated quassel.ico and .icns

5 years agoShip light and dark Breeze Icon theme by default
romibi [Thu, 1 Feb 2018 22:50:44 +0000 (23:50 +0100)]
Ship light and dark Breeze Icon theme by default