📜 ⬆️ ⬇️

DbNinja, MySQL and Comfort, Gtk, Qt and all, all

Where did you not start the search for the perfect gui for MySQL under Linux :)

My personal rating is this:
  1. HeidiSQL under Vayn
  2. Valentina Studio
  3. MySQL Workbench


Web-based solutions were not particularly interested for several reasons. But recently I came across a DbNinja project, and it became interesting. What it can do can be viewed on the project pages, for example, here . Someone is enough, some are few, but I’m talking about how to get rid of the browser and open IT in a separate window, without unnecessary ruches and bows.
')
In fact, everything is simple. We set the ninja, customizable. And we write simple:

#!/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; 


Everything! 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 difficult. The code is primitive right up to ugliness (I omit irrelevant details, attributes are registered 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 that. Trifle, but nice :)

Source: https://habr.com/ru/post/227097/


All Articles