tv_rename/gui.cpp

32 lines
838 B
C++
Raw Normal View History

2020-03-12 19:52:23 +00:00
#include "functions.hpp"
#include <errno.h>
#include <error.h>
2019-01-23 19:46:03 +00:00
#include <gtkmm/application.h>
2020-03-12 19:52:23 +00:00
#include <libintl.h>
#include <locale.h>
2019-01-23 19:46:03 +00:00
#include "mainwindow.hpp"
2020-03-12 19:52:23 +00:00
#include "resources_linux.h"
2020-01-16 10:12:22 +00:00
#include "tv_rename.hpp"
#define API_KEY "42B66F5E-C6BF-423F-ADF9-CC97163472F6"
2020-03-12 19:52:23 +00:00
#define DOMAIN "tv_rename"
2019-01-23 19:46:03 +00:00
2019-02-04 16:39:48 +00:00
int main( int argc, char **argv ) {
auto app = Gtk::Application::create(
argc, argv, "org.idonthaveanorganization.tvrename" );
2019-01-23 19:46:03 +00:00
2020-03-12 19:52:23 +00:00
if ( setlocale( LC_ALL, "" ) == NULL )
error( 1, errno, _( INVALID_LOCALE ).c_str() );
if ( bindtextdomain( DOMAIN, "./locale" ) == NULL )
error( 1, errno, _( MEM_ALLOC_FAILED ).c_str() );
if ( textdomain( DOMAIN ) == NULL )
error( 1, errno, _( MEM_ALLOC_FAILED ).c_str() );
2020-01-16 10:12:22 +00:00
authenticate( API_KEY );
2019-02-04 16:39:48 +00:00
MainWindow mw( app );
2019-01-23 19:46:03 +00:00
2019-02-04 16:39:48 +00:00
return app->run( mw );
2019-01-23 19:46:03 +00:00
}