maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] Webcat Browser (https://talk.maemo.org/showthread.php?t=92356)

llelectronics 2014-01-16 21:47

Re: [Announce] Webcat Browser
 
Update:
I worked on some stuff the last couple of days. Unfortunately I still don't get the whole cookie stuff (they changed a lot here between Qt4 and 5).
What I could get to work is clearing cookies by simply removing the file that stores the cookies on the filesystem. This needs however a restart which is currently triggered in the code.

To sum up the new features/fixes:
  • Fixed getting some links (especially relative ones) from site on longpress
  • Fixed requesting new page links that don't use _blank target
  • New default behavior "Open in New Tab" will open tab in background
  • Added set default search engine
  • Added a new icon based upon the one from Morpog (thx for that)
  • Added clear cookies to settings (in PullDown Menu)
  • Changed AddBookmark and settings to Dialog
  • Save userAgentName and use it as default for AddBookmarks aswell
  • Added 'Open in New Window'

RPM Download as usual from openrepos.net: https://openrepos.net/sites/default/....armv7hl_0.rpm

It takes a few days for the harbour version to be updated I guess.

parasemic 2014-01-17 07:19

Re: [Announce] Webcat Browser
 
I can't remove default bookmarks. They reappear on every launch.

youmeego 2014-01-17 07:29

Re: [Announce] Webcat Browser
 
what is that thing in the center of the earth? Remove it please?

MaemoUser 2014-01-17 07:59

Re: [Announce] Webcat Browser
 
It should be the eye of a cat I think. But for me it looks more like a lizard eye.

Morpog 2014-01-17 08:14

Re: [Announce] Webcat Browser
 
http://abload.de/img/unbenannt50cr6.jpg

phuig 2014-01-17 08:50

Re: [Announce] Webcat Browser
 
Google's mobile site doesn't work, anyone else experiencing same issue?

Cool browser otherwise. And new icon looks awesome.

Kabouik 2014-01-17 09:28

Re: [Announce] Webcat Browser
 
Quote:

Originally Posted by youmeego (Post 1407007)
what is that thing in the center of the earth? Remove it please?

I like it as it is. The icon is very good for an application named Webcat, in my opinion.

llelectronics 2014-01-17 09:52

Re: [Announce] Webcat Browser
 
Quote:

Originally Posted by phuig (Post 1407024)
Google's mobile site doesn't work, anyone else experiencing same issue?

Cool browser otherwise. And new icon looks awesome.

Google.com working fine.
G+ also.
If you have problems try another user agent maybe. Google is a bitch when it comes to blocking out some browsers who don't tell them to be android or ios.

Quote:

I can't remove default bookmarks. They reappear on every launch.
That is normal.
It is not possible to delete them currently. I need to take a look on how provide default bookmarks with the ability to delete them. It seems not as easy as it sounds ;)

nodevel 2014-01-17 13:35

Re: [Announce] Webcat Browser
 
Quote:

Originally Posted by llelectronics (Post 1407034)
I need to take a look on how provide default bookmarks with the ability to delete them. It seems not as easy as it sounds ;)

Need a hint? ;)

Here is my version of the db.transaction() function you have in your db.js

Code:

db.transaction(function(tx){
                    tx.executeSql('CREATE TABLE IF NOT EXISTS settings(key TEXT UNIQUE, value TEXT)');
                    var table  = tx.executeSql("SELECT * FROM settings");
                    // Insert default values
                    if (table.rows.length === 0) {
                        tx.executeSql('INSERT INTO settings VALUES(?, ?)', ["region", qsTr("1")]);
                        tx.executeSql('INSERT INTO settings VALUES(?, ?)', ["forecastIndex", 0]);
                        tx.executeSql('INSERT INTO settings VALUES(?, ?)', ["hidePush", 1]);
                    };
                });

The following code is how it is done (in your case, replace 'settings' with 'bookmarks'). Default bookmarks are going to reappear only if the bookmark database is empty.

Code:

var table  = tx.executeSql("SELECT * FROM settings");
if (table.rows.length === 0) {
...
}

It is convenient to load the bookmarks on the first run as well as the settings (I see that your 'default settings' loading is a bit different, but I see this as a more elegant way).

In case of settings, I just put following code in the main qml file:

Code:

function getSetting(key) {
            openDB();
            var res = "";
            db.transaction(function(tx) {
                var rs = tx.executeSql('SELECT value FROM settings WHERE key=?;', [key]);
                res = rs.rows.item(0).value;
            });
            return res;

        Component.onCompleted: {
            region = getSetting('region');
            forecastIndex = getSetting('forecastIndex');
            hidePush = getSetting('hidePush');
        }

I hope this helps :)

I really need to open source my app as soon as I have time to do it - this code posting is tiring :)

llelectronics 2014-01-17 13:46

Re: [Announce] Webcat Browser
 
Thanks that looks very interesting. I will take a look at it when I have time next week.


All times are GMT. The time now is 07:16.

vBulletin® Version 3.8.8