Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
fix: fix one column issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ppvan committed Oct 24, 2024
1 parent 5196e39 commit 74b995a
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 10 deletions.
15 changes: 13 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
{
"mesonbuild.configureOnOpen": true,
"mesonbuild.configureOnOpen": false,
"lldb.showDisassembly": "never",
"lldb.dereferencePointers": true,
"lldb.consoleMode": "commands"
"lldb.consoleMode": "commands",
"C_Cpp.default.compileCommands": "/home/ppvan/Documents/code/pet-projects/psequel/builddir/compile_commands.json",
"C_Cpp.default.configurationProvider": "mesonbuild.mesonbuild",
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/.hg/store/**": true,
".flatpak/**": true,
"_build/**": true
},
"mesonbuild.buildFolder": "_build",
"mesonbuild.mesonPath": "${workspaceFolder}/.flatpak/meson.sh"
}
1 change: 0 additions & 1 deletion resources/gtk/table-row.blp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Gtk 4.0;
using Gtk 4.0;
using Adw 1;

menu menu {
section {
Expand Down
2 changes: 0 additions & 2 deletions resources/gtk/table-structure-view.blp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Gtk 4.0;
using Gio 2.0;
using Adw 1;

template $PsequelTableStructureView: Gtk.Box {
orientation: vertical;
Expand Down
1 change: 0 additions & 1 deletion resources/gtk/view-data-view.blp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Gtk 4.0;
using Adw 1;

template $PsequelViewDataView: Gtk.Box {
width-request: 900;
Expand Down
20 changes: 20 additions & 0 deletions src/cmd.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace Psequel {
public static void main(string []args) {

ThreadPool<Worker> background = null;
try {
// Don't change the max_thread because libpq did not support many query with 1 connection.
background = new ThreadPool<Worker>.with_owned_data ((worker) => {
worker.run();
}, 1, false);
} catch (ThreadError err) {
debug(err.message);
assert_not_reached();
}

var sql_service = new SQLService(background);


print("Hello world");
}
}
6 changes: 3 additions & 3 deletions src/ui/schema/QueryResult.vala
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ namespace Psequel {
construct {
stack.visible_child_name = EMPTY;
rows = new ObservableList<Relation.Row> ();
alloc_columns(100);

this.bind_property("is-loading", stack, "visible-child-name", BindingFlags.SYNC_CREATE, (binging, from, ref to) => {
bool current_name = from.get_boolean();
Expand All @@ -74,20 +75,19 @@ namespace Psequel {
}

private async void load_data_to_view (Relation relation){

// Reset scrollbar
data_view.get_hadjustment().set_value(0);
data_view.get_vadjustment().set_value(0);

alloc_columns(1);
var columns = data_view.columns;
debug("Begin add rows to views");
for (int i = 0; i < 1; i++) {
for (int i = 0; i < relation.cols; i++) {
var raw_col = columns.get_item(i);
if (raw_col == null) {
break;
}
var col = raw_col as Gtk.ColumnViewColumn;

auto_set_sorter(col, relation.get_column_type(i), i);
col.set_title(relation.get_header(i));
col.set_visible(true);
Expand Down
2 changes: 1 addition & 1 deletion src/viewmodels/TableDataViewModel.vala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Psequel {
public class TableDataViewModel : DataViewModel {
public const int MAX_FETCHED_ROW = 200;
public const int MAX_FETCHED_ROW = 100;

public Table ? selected_table { get; set; }

Expand Down

0 comments on commit 74b995a

Please sign in to comment.