DbNinja, MySQL and comfort, Gtk, Qt and all-all-all

Wherever they started searching for the perfect guy for MySQL under Linux :)

My personal rating so far looks like this:
  1. HeidiSQL under Vine
  2. Valentina studio
  3. MySQL Workbench


Web-based solutions were not particularly interesting for a number of reasons. But recently I came across a DbNinja project , and it became interesting. What it can be seen on the pages of the project, for example, here . Enough for someone, not enough for someone, but I’m talking about how to get rid of the browser and open IT in a separate window, without extra ruffles and bows.

In fact, everything is simple. Install the ninja, customize. And write a simple one:

#!/usr/bin/perl
use strict;
use Gtk2 -init;
use Gtk2::WebKit;
use FindBin qw/$RealBin/;
my $window = Gtk2::Window->new;
   $window->set_default_size( 1280, 768 );
   $window->set_default_icon_from_file( $RealBin.'/dbninja.png');
   $window->set_title('DbNinja');
   $window->signal_connect( destroy => sub { Gtk2->main_quit } );
my $sw   = Gtk2::ScrolledWindow->new;
my $view = Gtk2::WebKit::WebView->new;
$sw->add( $view );
$window->add( $sw );
$view->open( 'http://127.0.0.1/dbninja/' );
$window->show_all;
Gtk2->main;


All! In fact, it turns out a separate application in a separate window, not at all like a browser .

Well, let's say not everyone has a pearl. But someone has Qt. It doesn’t matter, creating a similar program in Qt Creator is no more complicated. The code is primitive right up to the ugliness (I omit irrelevant details, the attributes are spelled out in the corresponding resources):

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    this->resize(1280, 768);
    QWebView *webView = new QWebView;
    QVBoxLayout *layout = new QVBoxLayout;
    this->centralWidget()->setLayout(layout);
    layout->addWidget(webView);
    webView->load(QUrl("http://127.0.0.1/dbninja/"));
}


Result

Something like this. A trifle, but nice :)

Also popular now: