diff --git a/gtk/databasewindow.cpp b/gtk/databasewindow.cpp index 3c90490..db09ade 100644 --- a/gtk/databasewindow.cpp +++ b/gtk/databasewindow.cpp @@ -28,7 +28,6 @@ DatabaseWindow::DatabaseWindow( property_modal().set_value( true ); set_default_size( 550, 350 ); - set_resizable( false ); auto *box = new Gtk::Box( Gtk::ORIENTATION_VERTICAL ); add( *box ); @@ -95,6 +94,11 @@ DatabaseWindow::DatabaseWindow( m_tree_database->signal_button_press_event().connect( sigc::mem_fun( *this, &DatabaseWindow::treeViewClick ) ); + // make columns resizable + for ( auto &column : m_tree_database->get_columns() ) { + column->set_resizable(true); + } + // create language combobox for treeview auto model = Gtk::ListStore::create( m_columns_language ); m_combo_language.property_model().set_value( model ); @@ -208,9 +212,6 @@ void DatabaseWindow::save() { auto *pw = new ProgressWindow; app->add_window( *pw ); - std::thread t = std::thread( refreshSelectDB, changed_rows, linux, pw ); - t.detach(); - // lambda capture auto *app_ptr = app.get(); @@ -221,6 +222,10 @@ void DatabaseWindow::save() { } ); pw->show(); + + std::thread t = std::thread( refreshSelectDB, changed_rows, linux, pw ); + t.detach(); + changed_rows.clear(); } diff --git a/gtk/gui.cpp b/gtk/gui.cpp index 4a7fb07..ec43bf5 100644 --- a/gtk/gui.cpp +++ b/gtk/gui.cpp @@ -31,9 +31,8 @@ int main( int argc, char **argv ) { error( 1, errno, _( MEM_ALLOC_FAILED ).c_str() ); } + // TODO let user know that program is authenticating and will start shortly authenticate( API_KEY ); - MainWindow mw( app ); - return app->run( mw ); } diff --git a/gtk/mainwindow.cpp b/gtk/mainwindow.cpp index 58ee022..259e154 100644 --- a/gtk/mainwindow.cpp +++ b/gtk/mainwindow.cpp @@ -155,7 +155,6 @@ void MainWindow::finishedSelection() { std::unique_ptr< Gtk::Dialog > dialog( new Gtk::Dialog( _( RENAME_CONFIRM ), *this ) ); dialog->set_default_size( 550, 350 ); - dialog->set_resizable( false ); auto content = dialog->get_content_area(); std::unique_ptr< Gtk::ScrolledWindow > sc_w( new Gtk::ScrolledWindow ); @@ -216,7 +215,6 @@ MainWindow::MainWindow( const Glib::RefPtr< Gtk::Application > &ptr ) Gtk::Label *label_pattern = new Gtk::Label(); set_default_size( 400, 345 ); - set_resizable( false ); { // if cached pattern exists, load that instead of default @@ -459,9 +457,9 @@ void MainWindow::dbUpdate() { app_ptr->remove_window( *pw ); delete pw; } ); + pw->show(); std::thread t( updateDB, !m_check_linux->get_active(), pw ); t.detach(); - pw->show(); } void MainWindow::dbClean() { @@ -477,9 +475,9 @@ void MainWindow::dbRefresh() { app_ptr->remove_window( *pw ); delete pw; } ); + pw->show(); std::thread t( refreshDB, !m_check_linux->get_active(), pw ); t.detach(); - pw->show(); } void MainWindow::dbAdd() { @@ -514,12 +512,12 @@ void MainWindow::dbAdd() { delete pw; } ); + pw->show(); std::thread t( addToDB, std::move( show ), m_entry_dir->get_text(), std::move( language_code ), std::move( show_id ), getDBPattern(), !m_check_linux->get_active(), m_check_dvd->get_active(), pw ); t.detach(); - pw->show(); } void MainWindow::dbManage() { diff --git a/gtk/searchwindow.cpp b/gtk/searchwindow.cpp index 0b2c5bf..7ad4eea 100644 --- a/gtk/searchwindow.cpp +++ b/gtk/searchwindow.cpp @@ -41,7 +41,6 @@ SearchWindow::SearchWindow( std::string &_show, std::string &_id, language_map( _languages ) { set_title( _( GUI_WINDOW_SEARCH ) ); property_modal().set_value( true ); - set_resizable( false ); auto *box = new Gtk::Box( Gtk::ORIENTATION_VERTICAL ); add( *box ); diff --git a/gtk/seasonwindow.cpp b/gtk/seasonwindow.cpp index df69c00..e2c8fa7 100644 --- a/gtk/seasonwindow.cpp +++ b/gtk/seasonwindow.cpp @@ -36,7 +36,6 @@ SeasonWindow::SeasonWindow( const std::vector< int > &seasons, set_title( _( GUI_WINDOW_SEASON ) ); set_default_size( 250, 250 ); - set_resizable( false ); add( m_layout );