Formatting

This commit is contained in:
zvon 2020-04-01 16:13:39 +02:00
parent aa049ff203
commit 991a21af4e
26 changed files with 68 additions and 63 deletions

View File

@ -12,9 +12,9 @@
#ifdef _WIN32
#include "resources_windows.h"
#include <codecvt>
#include <shlobj.h>
#include "resources_windows.h"
#define cout std::wcout
#define cerr std::wcerr
@ -24,11 +24,11 @@ constexpr const char_t *dir_divider = L"\\";
#else // UNIX
#include "resources_linux.h"
#include <pwd.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include "resources_linux.h"
#define cout std::cout
#define cerr std::cerr
@ -611,7 +611,8 @@ void refreshDB( bool linux, void *progress_ptr ) {
#ifndef GUI
cleanUpLine();
#endif
p.print( _( REFRESHING ) + string( 1, ' ' ) + show[TEXT( "SHOW" )] );
p.print( _( REFRESHING ) + string( 1, ' ' ) +
show[TEXT( "SHOW" )] );
p.print( 0 );
std::map< int, std::map< int, string > > seasons;

View File

@ -7,13 +7,13 @@
#include <iostream>
#include <thread>
#include "databasewindow.hpp"
#include "gtkfunctions.hpp"
#include "progresswindow.hpp"
#include "../filesystem.hpp"
#include "../functions.hpp"
#include "../resources_linux.h"
#include "../tv_rename.hpp"
#include "databasewindow.hpp"
#include "gtkfunctions.hpp"
#include "progresswindow.hpp"
DatabaseWindow::~DatabaseWindow() {
auto children = get_children();

View File

@ -4,11 +4,11 @@
#include <libintl.h>
#include <locale.h>
#include "mainwindow.hpp"
#include "../filesystem.hpp"
#include "../functions.hpp"
#include "../resources_linux.h"
#include "../tv_rename.hpp"
#include "mainwindow.hpp"
#define API_KEY "42B66F5E-C6BF-423F-ADF9-CC97163472F6"
#define DOMAIN "tv_rename"

View File

@ -8,14 +8,14 @@
#include <iostream>
#include <thread>
#include "databasewindow.hpp"
#include "gtkfunctions.hpp"
#include "mainwindow.hpp"
#include "progresswindow.hpp"
#include "../filesystem.hpp"
#include "../functions.hpp"
#include "../resources_linux.h"
#include "../tv_rename.hpp"
#include "databasewindow.hpp"
#include "gtkfunctions.hpp"
#include "mainwindow.hpp"
#include "progresswindow.hpp"
void MainWindow::chooseFile() {
// create a dialog for choosing directory

View File

@ -14,8 +14,8 @@
#include <gtkmm/window.h>
#include <set>
#include "seasonwindow.hpp"
#include "../network.hpp"
#include "seasonwindow.hpp"
class MainWindow : public Gtk::Window {
public:

View File

@ -1,7 +1,7 @@
#include "progresswindow.hpp"
#include <gtkmm/liststore.h>
#include <mutex>
#include "progresswindow.hpp"
#include "../functions.hpp"
#include "../resources_linux.h"

View File

@ -17,6 +17,7 @@ public:
void setLabel( const std::string &text ) {
label->set_text( text );
}
private:
std::unique_ptr< Gtk::Layout > layout{ new Gtk::Layout() };
std::unique_ptr< Gtk::Label > label{ new Gtk::Label() };

View File

@ -4,11 +4,11 @@
#include <gtkmm/messagedialog.h>
#include <iostream>
#include "gtkfunctions.hpp"
#include "searchwindow.hpp"
#include "../functions.hpp"
#include "../resources_linux.h"
#include "../tv_rename.hpp"
#include "gtkfunctions.hpp"
#include "searchwindow.hpp"
void SearchWindow::search() {
language_code =

View File

@ -4,10 +4,10 @@
#ifdef _WIN32
#include <windows.h>
#include "resources_windows.h"
#include <fcntl.h>
#include <io.h>
#include <windows.h>
using char_t = wchar_t;
using string = std::wstring;
@ -19,8 +19,8 @@ using string = std::wstring;
#else
#include "resources_linux.h"
#include <error.h>
#include <errno.h>
#include <error.h>
#include <getopt.h>
using char_t = char;

View File

@ -8,8 +8,8 @@
#ifdef _WIN32
#include <windows.h>
#include <conio.h>
#include <windows.h>
#include <winuser.h>
#define cout std::wcout

View File

@ -17,8 +17,8 @@
#ifdef _WIN32
#include <windows.h>
#include "resources_windows.h"
#include <windows.h>
#include <codecvt>
#include <fcntl.h>

View File

@ -2,12 +2,12 @@
name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"" )
#include "databasewindow.hpp"
#include "gui_functions.hpp"
#include "progresswindow.hpp"
#include "searchwindow.hpp"
#include "../filesystem.hpp"
#include "../functions.hpp"
#include "../resources_windows.h"
#include "gui_functions.hpp"
#include "progresswindow.hpp"
#include "searchwindow.hpp"
#include <commctrl.h>
#include <fstream>

View File

@ -1,7 +1,7 @@
#include <windows.h>
#include <string>
#include <tuple>
#include <vector>
#include <windows.h>
class DatabaseWindow {
public:

View File

@ -1,7 +1,7 @@
#include <windows.h>
#include "../filesystem.hpp"
#include <Shlwapi.h>
#include <cstring>
#include <windows.h>
FSLib::Directory::Directory( const string &path_ ) : dir_path( path_ ) {
// need to append \\* for windows to search files in directory

View File

@ -1,12 +1,12 @@
#include "gui_functions.hpp"
#include "../functions.hpp"
#include "../resources_windows.h"
#include "databasewindow.hpp"
#include "mainwindow.hpp"
#include "patternwindow.hpp"
#include "progresswindow.hpp"
#include "searchwindow.hpp"
#include "seasonwindow.hpp"
#include "../resources_windows.h"
#include "../functions.hpp"
#include <shlobj.h>

View File

@ -1,6 +1,6 @@
#include <windows.h>
#include <commctrl.h>
#include <string>
#include <windows.h>
void registerWindowClasses( HINSTANCE hInstance );
void centerWindow( HWND hwnd );

View File

@ -2,16 +2,16 @@
name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"" )
#include "mainwindow.hpp"
#include "../filesystem.hpp"
#include "../functions.hpp"
#include "../resources_windows.h"
#include "../tv_rename.hpp"
#include "databasewindow.hpp"
#include "gui_functions.hpp"
#include "patternwindow.hpp"
#include "progresswindow.hpp"
#include "searchwindow.hpp"
#include "seasonwindow.hpp"
#include "../filesystem.hpp"
#include "../functions.hpp"
#include "../resources_windows.h"
#include "../tv_rename.hpp"
#include <fstream>
#include <thread>
@ -101,8 +101,8 @@ MainWindow::MainWindow( HINSTANCE hInstance, int nCmdShow )
hFont );
trust_input = createCheckbox( _( DONT_RENAME_CONFIRM ), 90, 146, 180, 12,
ID_RENAME_CHECKBOX, window, hFont );
dvd_input = createCheckbox( _( USE_DVD ), 5, 170, 180, 12,
ID_DVD_CHECKBOX, window, hFont );
dvd_input = createCheckbox( _( USE_DVD ), 5, 170, 180, 12, ID_DVD_CHECKBOX,
window, hFont );
possible_input = createCombo( 5, 205, 160, window_height - 220,
ID_SHOW_COMBO, window, hFont );
rename_button = createButton( _( RENAME ), 5, 230, 80, 25, ID_RENAME_BUTTON,
@ -126,7 +126,8 @@ MainWindow::MainWindow( HINSTANCE hInstance, int nCmdShow )
_( CHANGE_DB_PATTERN ) );
AppendMenuW( hMenuBar, MF_POPUP, ( UINT_PTR )hMenuFile, _( ID_FILE ) );
AppendMenuW( hMenuBar, MF_POPUP, ( UINT_PTR )hMenuDatabase, _( DATABASE_MENU ) );
AppendMenuW( hMenuBar, MF_POPUP, ( UINT_PTR )hMenuDatabase,
_( DATABASE_MENU ) );
SetMenu( window, hMenuBar );
INITCOMMONCONTROLSEX icex; // Structure for control initialization.
@ -234,7 +235,8 @@ void MainWindow::process() {
wchar_t show[256];
SendMessage( show_input, WM_GETTEXT, ( WPARAM )255, ( LPARAM )show );
if ( wcslen( show ) == 0 ) {
MessageBox( window, _( SHOW_FIELD_EMPTY ), _( ERROR ), MB_OK | MB_ICONERROR );
MessageBox( window, _( SHOW_FIELD_EMPTY ), _( ERROR ),
MB_OK | MB_ICONERROR );
return;
}

View File

@ -1,5 +1,5 @@
#include <windows.h>
#include <string>
#include <windows.h>
class PatternWindow {
public:

View File

@ -1,5 +1,5 @@
#include <windows.h>
#include <string>
#include <windows.h>
class ProgressWindow {
public:

View File

@ -2,10 +2,10 @@
name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"" )
#include "searchwindow.hpp"
#include "gui_functions.hpp"
#include "../functions.hpp"
#include "../resources_windows.h"
#include "../tv_rename.hpp"
#include "../functions.hpp"
#include "gui_functions.hpp"
#define ID_SHOW_STATIC 0x0001
#define ID_LANG_STATIC 0x0002
@ -111,7 +111,8 @@ void SearchWindow::process() {
wchar_t show[256];
SendMessage( show_input, WM_GETTEXT, ( WPARAM )255, ( LPARAM )show );
if ( wcslen( show ) == 0 ) {
MessageBox( window, _( SHOW_FIELD_EMPTY ), _( ERROR ), MB_OK | MB_ICONERROR );
MessageBox( window, _( SHOW_FIELD_EMPTY ), _( ERROR ),
MB_OK | MB_ICONERROR );
return;
}

View File

@ -1,6 +1,6 @@
#include <windows.h>
#include <string>
#include <vector>
#include <windows.h>
class SearchWindow {
public:

View File

@ -2,9 +2,9 @@
name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"" )
#include "seasonwindow.hpp"
#include "../functions.hpp"
#include "../resources_windows.h"
#include "gui_functions.hpp"
#include "../functions.hpp"
#define ID_CHECKBOX 0x0001
#define ID_SEASONS_STATIC 0x0001

View File

@ -1,6 +1,6 @@
#include <windows.h>
#include <string>
#include <vector>
#include <windows.h>
class SeasonWindow {
public: